|
20-07-2008 |
Zoom Javascript sur image
Zoom sur image, simple, efficace....
Zoom In | Normal | Zoom Out
Script trouvé sur : 
Les codes pour installer le script :
<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*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>
|
Les codes Html pour déclencher le script :
<a href="#" onmouseover="zoom(200,177,'logo','in')" onmouseout="clearzoom()">Zoom In</a> | <a href="#" onmouseover="zoom(200,177,'logo','restore')">Normal</a> | <a href="#" onmouseover="zoom(200,177,'logo','out')" onmouseout="clearzoom()">Zoom Out</a><br><br><br>
<div style="position:relative;width:200;height:177" align="center"><div style="position:absolute">
<img name="logo" src="laurel.gif" width="200" height="177">
</div></div>
|
Il vous faut juste changer la taille de l'image par la votre, ainsi que son nom et son url, le reste se fait tout seul....
Citez cet article
|
- Les messages comportant des attaques verbales contre les personnes seront supprimés.
- Vous pouvez renouveler le code de sécurité en appliquant un rafraîchissement à votre navigateur.
- Appliquer cette méthode de rafraîchissement si vous avez entré un mauvais code de sécurité.
|
Powered by AkoComment Tweaked Special Edition v.1.4.6 AkoComment © Copyright 2004 by Arthur Konze - www.mamboportal.com All right reserved |