question with photos

Discussion in 'JavaScript' started by progfrog, Feb 6, 2008.

  1. #1
    hi guys
    I nees some help with this code that doesn't work- it sepose to make a dblclick on photos and than resize them. for sime reason this doesn't work- thi is thr code:


    need you soon
    prog frog



    <html>
    <head>
    <title> several pictures</title>
    <script language="javascript" type="text/javascript">
    function newSize(picId){
    
     var pic=document.getElementById(picId);
     var imgWindow=window.open(pic,"imgwin","width=320,height=240");
    
    
    }
    
    </script>
    
    </head>
    
    
    
    
    <body>
    <h2> click on pictures</h2>
    <img src="1.jpg" width="160" height="120" border="2" id="1" onDblclick="newSize('1')">
    <img src="2.jpg" width="160" height="120" border="2" id="2"onDblclick="newSize('2')">
    </body>
    </html>
    HTML:
     
    progfrog, Feb 6, 2008 IP
  2. fairuz.ismail

    fairuz.ismail Peon

    Messages:
    232
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #2
    it's var pic=document.getElementsById(picId); not var pic=document.getElementById(picId);
     
    fairuz.ismail, Feb 6, 2008 IP