This script opens a window using the image dimensions as the control. When you do not want to jeopardize convention and need a Click to enlarge Button, use this code.
<script><!--
function imagePopUp(img) {
html = "<html><head><title>Enlarged Image</title>" + "</head><body style="margin: 0px 0; text-align:center; ">" + "<IMG src='" + img + "' BORDER=0 NAME=image " + "onload='window.resizeTo(document.image. width,(document.image.height*1.3))'>" + "</body></html>"; popup=window.open ('','image','toolbar=0,location=0, directories=0,menuBar=0, scrollbars=0,resizable=1'); popup.document.open(); popup.document.write(html); popup.document.focus(); popup.document.close() }; //--></script>
To call the script use a simple link.
<a href="javascript:imagePopUp('../images/yourimage.gif')"'>Click to enlarge</a>
This script is modified code found @ www.rgagnon.com
4 comments ↓
If you found this post useful click the share this button. Contribute below by adding a comment, no registration is required.
DCE's Hottest Posts
Learn to Swap your ALT and CTRL keys in Windows XP. Windows has something called Scancode keys built in (but not really); this will let you switch the positioning of your alt and ctrl key to act like an apple layout. The jump from Apple Command to CTRL is messing with my pinky so lets fix it. Read Full Article...
Read Full Article...
Read Full Article...
egerg
egytrf
teşekkürler emeğe saygı..
Çok teşekkürler başarılı
Leave a Comment