Results 1 to 3 of 3

Thread: please help

  1. #1
    Join Date
    Mar 2006
    Posts
    75
    Thanks
    17
    Thanked 0 Times in 0 Posts

    Default please help

    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.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by momonline
    Code:
    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):

    Code:
    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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Mar 2006
    Posts
    75
    Thanks
    17
    Thanked 0 Times in 0 Posts

    Thumbs up

    John,

    Thanks for your time, it worked!

    Marsha

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •