Javascript hover

Discussion in 'JavaScript' started by dean5000v, Jul 11, 2008.

  1. #1
    ok well i've done a gallery in CSS and was wondering if anyone know some JavaScript to enlarge a version of the image on mouse over ?
     
    dean5000v, Jul 11, 2008 IP
  2. anwaraa

    anwaraa Active Member

    Messages:
    167
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    90
    Digital Goods:
    2
    #2
    Quite simple: img1=cropped image, img2=original size

    <a href="#" onmouseover="document.images.example.src='img2.gif';" onmouseout="document.images.example.src='img1.gif';" ><img src="img1.gif" border="0" name="example" /></a>
    HTML:
     
    anwaraa, Jul 11, 2008 IP
  3. dean5000v

    dean5000v Peon

    Messages:
    201
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    i just want it to open a larger image within a pop window on hover without having to click on the actual link.
     
    dean5000v, Jul 11, 2008 IP
  4. anwaraa

    anwaraa Active Member

    Messages:
    167
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    90
    Digital Goods:
    2
    #4
    The onmouseover given previously and now is on hover and no clicking reqd. I think this is what you need.

    <a href="#" onmouseover="window.open ('pathToOriginalImage');">cropped image url</a>
    Code (markup):
     
    anwaraa, Jul 11, 2008 IP
  5. dean5000v

    dean5000v Peon

    Messages:
    201
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    thanks for the help so far but thats just goin to do it on a link, i mean i wont it so when you scroll over the thumbnail image it will popup with a larger version of the image.
     
    dean5000v, Jul 11, 2008 IP