Log in

View Full Version : Javascript onclick image swap help needed


kersti
04-14-2009, 07:16 AM
I'm trying to copy the fade transitions on http://www.boston.com/bigpicture/2009/0 ... _2009.html and having so much trouble - it's driving me crazy!

Problem is that I'm doing this in a .NET CMS environment with no access to the underlying CSS and the images are always offset so there's a jump. I've tried playing around with the positioning offset and that doesn't seem to work at all.

I need something that'll work inline. I used to use a lovely bit of code that would swap images on rollover - can anyone help me to adapt that to swap on click instead with a fade? Anyone have some code to preload as well for these?

The code I used to use is:

<A HREF="xxx.html"
OnMouseOver="document.images['link'].src='link_on.gif';"
OnMouseOut="document.images['link'].src='link_off.gif'"><IMG
SRC="link_off.gif" HEIGHT="15" WIDTH="100" BORDER="0" NAME="link"></A>

--------------- Added 1239700679 at 1239700679 ---------------

That first link should be http://www.boston.com/bigpicture/2009/03/earth_hour_2009.html