PDA

View Full Version : Activate link via class name on load?



OlivertheAfter
18 Aug 2009, 12:50 PM
Hello, I apologise for asking for help straight after joining, although would love it if you would indulge me.

I have a working knowledge of CSS and HTML, although my understanding of Javascript and related concepts are virtually nil. That said, I'm all up for learning.

My problem is:

I have a client (whom I have made a site for), who now wants an animation to be presented to viewers on the splash page of the site. I know how undesirable this is (or a splash page, for that matter), but they are adamant, so I'm seeing what I can do. My solution so far is to have the animation as .swf and have it load in a lightbox variant called Lightwindow, (with the option for viewers to skip) on body load. I've been trawling the web for a couple days now, but haven't been successful. The closest I've got is using <body onload=getElementById...>, and hiding a link to the animation at the bottom of the page. Problem is, I've assigned the link a class name to tell it to play in the lightwindow. My next thought was to look for a getElementByClassName script, which I have now got, but have no idea how to use :(.

I'm aware that I should really be setting about learning some Javascript from the ground up, however I really need to get this done now, and I don't have enough time to learn enough to get to the point where I am able to do this. Can anyone show me how to activate this link via Javascript so that the animation will play when the page loads? Or if what I am doing makes you shudder so horrendously, would you please show me a better way of making this happen?

I've been scratching around with JQuery, but I'm clueless, really. Thanks, some help will be very much appreciated.