Morpheusweb.it - Risorse per webmaster: script, ASP.NET, C#, Visual Basic .Net, tutorial, asp, javascript, css, php, html, java, ADO, VBScript, forms, frames, Active Server Pages, Dynamic HTML, database, gratis per webmaster e webdesigner

Lente di Ingrandimento

Effetto lente di ingrandimento su di un'immagine.



<HTML>
<head>
<title>Demo dhtml - www.risorse.net</title>
<script language="JavaScript">
//funzione che ingrandisce
function lentep() {
//l'ingrandimento avviene moltiplicando per 2 i valori
//di altezza e larghezza dell'immagine
document.img1.width=document.img1.width*2
document.img1.height=document.img1.height*2
}
//funzione che rimpicciolisce
function lentem() {
//idem come sopra ma dividendo per 2
document.img1.width=document.img1.width/2
document.img1.height=document.img1.height/2
}
</script>
</head>
<body>
<center>
<h2>Lente di ingrandimento su immagine</h2>
<br>
<a href="#" onMouseOver="lentep()" onMouseOut="lentem()">
<img name="img1" src="foto2.jpg" width=120 height=80 border=1>
</a>
</center>
</body>
</HTML>


Scarica il Codice...


Stampa la pagina


 

Inizio pagina

risorse per webmaster