совсем не так делал
| Код | <html> <head> <title>Expanding Image Script</title> <style type="text/css"> #imageHolder {position:absolute; left:100; top:100; width:500; height:250; background-color:none;} </style> <script language="JavaScript"> //dynamic image resizing var x1 = 100, y1 = 50, x2 = 200, y2 = 100, dx = 2, dy = 1, x, y; //image starting width and height goes here
//img_height = 50; //timer = null; function imageGrow(img, s) { if(x > x2 || y > y2) return; x = x1 + s*dx; y = y1 + s*dy; img.style.width = x + 'px'; img.style.height = y + 'px'; s++; setTimeout(function(){imageGrow(img, s);}, 20); } </script> </head> <body > Bla bla <div id="imageHolder" align="center"> <img src="images/1.jpg" border="0" width="100" height="50" id="imageResize" align="center" onclick="imageGrow(this, 1)" /> </div> </body>
|
|