Sunday, November 30, 2008

Events

JavaScript has been really challenging lately and events added onto that struggle. Thinking about events, I can say we all have ran into events on websites before. I think that events, if planned out in advance, can be easily accomplished in regards to simple tasks.

However, I found it rather frustrating trying to incorporate events into my website that I've been, on a step-by-step process, building together. I now see that CSS can have a huge effect on JavaScript because CSS alters the appearance of your content, whereas JavaScript relies on the shape of your content to act a certain way.

My problem was that my links based on my entire website's style versus the style of the accordion event were interfering with each other. I think I know why accordion is used mainly for navigation, because links specified for navigation could be set with the accordion style. Therefore, that would leave all the links in the content alone.

What I ended up doing was setting a style in the head of the HTML file for the pages that have links. I couldn't exactly get the accordion links to act separate from the content, so I had to pull my site in reverse and start building parts of it over. It was not a simple tasks. :|

Overall, if I had planned on using events from the beginning, I think I wouldn't have had much trouble. Events are useful no doubt, but I sometimes think that using a lot of advance markup can clash with other markup and make a mess of your site. What may have started out as a chore could have ended up as a fierce struggle between man and beast!

3 comments:

Mercedes said...

I totally have to agree with you on the idea of planning out your content, including JavaScript first. I had very similar problems on mine. For some reason on the tooltip, it didn't like my div organization or something. Bleeeh.

I'm really glad that you're making it through this though, and I'm glad I wasn't the only one who had problems!

Janina said...

I also had difficulties on this. I typed out everything for my accordion, then discovered I had set up my lists wrong and had to redo them. If I would have just paid more attention when I was setting it all up, it would have saved me a lot of time.
Of course when we were setting up our sites, we didn't know what the future would bring for them!

Carla said...

I think that a person needs to plan for JavaScript when designing a site. By adding it later can really throw a bug into things.

I am afraid that when it comes time to put JavaScript into someones web site I will have to cheat. I would feel comfortable about changing some of the coding to make it work on the site.

Good luck JavaScripting.