»
EnglishFrenchVietnamese

Print - Zoom in/out onMouseover - JavaScriptBank.com

Full version: jsB@nk » Image » Image viewer » Zoom in/out onMouseover
URL: https://www.javascriptbank.com/zoom-inout-onmouseover.html

Zoom in/out onMouseover © JavaScriptBank.comThe effect will zoom in/out image when user move mouse on links.

Full version: jsB@nk » Image » Image viewer » Zoom in/out onMouseover
URL: https://www.javascriptbank.com/zoom-inout-onmouseover.html



JavaScript
<script language="JavaScript1.2">var zoomfactor=0.05 //Enter factor (0.05=5%)function zoomhelper(){if (parseInt(whatcache.style.width)>10&&parseInt(whatcache.style.height)>10){whatcache.style.width=parseInt(whatcache.style.width)+parseInt(whatcache.style.width)*zoomfactor*prefixwhatcache.style.height=parseInt(whatcache.style.height)+parseInt(whatcache.style.height)*zoomfactor*prefix}}function zoom(originalW, originalH, what, state){if (!document.all&&!document.getElementById)returnwhatcache=eval("document.images."+what)prefix=(state=="in")? 1 : -1if (whatcache.style.width==""||state=="restore"){whatcache.style.width=originalWwhatcache.style.height=originalHif (state=="restore")return}else{zoomhelper()}beginzoom=setInterval("zoomhelper()",100)}function clearzoom(){if (window.beginzoom)clearInterval(beginzoom)}</script><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<a href="#" onmouseover="zoom(120,60,'myimage2','in')" onmouseout="clearzoom()">Zoom In</a> | <a href="#" onmouseover="zoom(120,60,'myimage2','restore')">Normal</a> | <a href="#" onmouseover="zoom(120,60,'myimage2','out')" onmouseout="clearzoom()">Zoom Out</a><br><img name="myimage2" src="logojs.gif" width="150" height="60"><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->