1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<body bgcolor="#FFFFFF">
<a href="#" onmouseover="javascript:zoom_restaurer(); zoom_plus();"
onmouseout="javascript:zoom_pause();">zoom+</a>
<a href="#"
onmouseover="javascript:zoom_restaurer(); zoom_original();">original</a>
<a href="#" onmouseover="javascript:zoom_restaurer(); zoom_moins();" onmouseout="javascript:zoom_pause();">zoom-</a><br />
<img src="../img.jpg" id="zoom" name="zoom" width="1280" height="960" />
<script language="javascript">
var largeur_max=1900;
var largeur_min=10;
var delai=1;
var pas=2;
var hauteur_orig = document.images[0].height;
var largeur_orig = document.images[0].width;
var delai_ori=delai;
</script>
<script language="javascript">
function zoom_moins(){
if(document.images[0].width>largeur_min){
document.images[0].width-=pas;
var q = document.images[0].width-=pas;
var largeur_courante = document.images[0].width;
document.images[0].height=Math.round(q*(hauteur_orig/largeur_orig));
setTimeout("zoom_moins()",delai);
}
}
function zoom_plus(){
if(document.images[0].width<largeur_max){
document.images[0].width+=pas;
var q = document.images[0].width+=pas;
var largeur_courante = document.images[0].width;
document.images[0].height=Math.round(q*(hauteur_orig/largeur_orig));
setTimeout("zoom_plus()",delai);
}
}
function zoom_restaurer(){
delai=delai_ori;
}
function zoom_pause(){
delai=10000000000.
}
function zoom_original(){
document.images[0].width=largeur_orig;
document.images[0].height=hauteur_orig;
}
</script>
</body>
</html> |
Partager