Log in

View Full Version : please help



momonline
03-28-2006, 03:25 AM
hi all, i need help with the conveyor belt script - specifically, can i "swap" an image with a mouse rollover while going through the conveyor -- NOT ON CLICK (i already have the images linked) -- i just want it to swap to a different version of the image on rolling over the image.

can this be done?

leftrightslide[0]='<a href="http://www.....org/MOMa1.htm"></DIV><img src="a1_small.jpg" height="45" border=1></a>'
leftrightslide[1]='<a href="http://www......org/MOMb1.htm"><img src="c1_small.jpg" height="45" border=1></a>'

if so, where does it go? i've tried a bunch of different things to try to get it to work, but haven't had any success -- i've looked in other threads on this site to no avail.

thanks in advance,

M.O.M.

jscheuer1
03-28-2006, 04:48 AM
leftrightslide[0]='<a href="http://www.....org/MOMa1.htm"></DIV><img src="a1_small.jpg" height="45" border=1></a>'
leftrightslide[1]='<a href="http://www......org/MOMb1.htm"><img src="c1_small.jpg" height="45" border=1></a>'

Probably just forgot to get rid of the red </DIV> when you got rid of the opening tag for it but, a closing tag in a spot like this that has no opening tag can sometimes create real problems.

On to your question, you can use a simple rollover event, you just need to make sure your quotes are kept straight and/or escaped if needed (like quotes inside strings delimited by like quotes must be escaped, otherwise the script thinks it has reached the end of the string):


leftrightslide[1]='<a href="http://www......org/MOMb1.htm"><img src="c1_small.jpg" height="45" border="1" onmouseover="this.src=\'c1_small_over.jpg\';" onmouseout="this.src=\'c1_small.jpg\';"></a>'

It might be a good idea to preload your rollover images so that there is little or no delay come rollover time but, that is another lesson. Also, due to event bubbling, some browsers may have a problem with this because the entire conveyor pauses onmouseover, if memory serves.

momonline
03-28-2006, 02:24 PM
John,

Thanks for your time, it worked!

Marsha