Homepage » Javascript » Scripts » In/uit zoomer op plaatjes
| Info | ||||
| Door: | Dmitri | Moeilijkheidsgraad: | ![]() | |
| Geplaatst op: | 06-04-2005 | Reacties: | 1(Bekijken) | |
| Views: | 5899 | Log in om zelf te reageren | ||
| Laatste keer aangepast op 08-04-2005 door gabber | Waardering: | |||
Uitleg
Verander wel even het "adres" van het plaatje bijvorbeeld:
http://www.google.nl/intl/nl_nl/images/logo.gif
Plaats dit gedeelte in de body van je pagina:
<!--Verander wel het adres van het plaatje--> <div style="position:relative;width:120;height:60"><div style="position:absolute"> <img name="myimage2" src="http://www.google.nl/intl/nl_nl/images/logo.gif"> </div></div></center> <center><script language="JavaScript1.2"> <!-- Voor de leukste scripts gaat u naar...--> <!-- Sentinelli’s Javascript! The source for all your Javascript and PHP --> 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*prefix whatcache.style.height=parseInt(whatcache.style.height)+parseInt(whatcache.style.height)*zoomfactor*prefix } } function zoom(originalW, originalH, what, state){ if (!document.all&&!document.getElementById) return whatcache=eval("document.images."+what) prefix=(state=="in")? 1 : -1 if (whatcache.style.width==""||state=="restore"){ whatcache.style.width=originalW whatcache.style.height=originalH if (state=="restore") return } else{ zoomhelper() } beginzoom=setInterval("zoomhelper()",100) } function clearzoom(){ if (window.beginzoom) clearInterval(beginzoom) } </script> <!-- BEGIN SECOND BLOCK--> <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><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> <!--<div style="position:relative;width:120;height:60"><div style="position:absolute"> <img name="myimage2" src="http://www.sentinelli.nl/1.jpg"> </div></div></center> -->
| 1 reactie | |
| bass | |
![]() Regular |
noobig |
Pagina 1
Om te reageren moet je ingelogd zijn.
Nog niet geregistreerd? Doe dat dan nu!
Check je domein...
Websitemaken wordt gehost door Nucleus.be

