DarkTerror Posted August 28, 2007 Share Posted August 28, 2007 Hey guyz, Can anyone help me regarding the script which this page uses for photo scaling. See the link please: http://tinyurl.com/2f64f4 I even dont know which language it's using so posted in javascript as i think it to be that. Actually i want to know how the image is scaling to fit the screen after it fully loads and on a mouse click over it it regains it original size. Help! Quote Link to comment Share on other sites More sharing options...
php_tom Posted August 30, 2007 Share Posted August 30, 2007 You're right, it's JavaScript. Try this: <html> <head> <script> var big=false; function toggleSize() { if(big) { document.getElementById('img1').style.width='100px'; big = !big; } else { document.getElementById('img1').style.width='1000px'; big = !big; } } </script> </head> <body> <img src='myImage.jpg' id='img1' onclick='toggleSize()' width='100'/> </body> </html> Replace 'myImage.jpg' with your image url, and set the widths to whatever you want. Hope that helps. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.