Linking Images with JavaScripting

Discussion in 'JavaScript' started by Chompie, Mar 24, 2008.

  1. #1
    I have an image, and I want to have the image - so that when someone clicks the image a pop-up window appears.

    I know how to make it so that when someone clicks a link that is text a pop-up window appears, but I dont know how to have an image instead of text and have it clickable so that a pop up window appears, here is my code below - any tips would be great! Thanks,

    <a href="http://webaddress.com" onclick="window.open('http://webaddress.com','popup','width=1000,height=1200,scrollbars=no,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false">General Information</a>

    Thanks!
     
    Chompie, Mar 24, 2008 IP
  2. EvinDesign

    EvinDesign Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    just put your onclick handler inside your <img> tag
     
    EvinDesign, Mar 24, 2008 IP