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! Link to comment https://forums.phpfreaks.com/topic/67134-help-required-about-image-scaling/ 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. Link to comment https://forums.phpfreaks.com/topic/67134-help-required-about-image-scaling/#findComment-337682 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.