tropik99
Messages postés2Date d'inscriptionmercredi 28 juillet 2004StatutMembreDernière intervention20 septembre 2005
-
20 sept. 2005 à 10:34
tropik99
Messages postés2Date d'inscriptionmercredi 28 juillet 2004StatutMembreDernière intervention20 septembre 2005
-
20 sept. 2005 à 11:59
Bonjour,
J'ai trouvé sur le net un javascript qui permet de zoomez et dézoomer sur une image, je l'ai adapté pour le faire fonctionner avec un fichier FLASH, il fonctionne parfaitement sous IE et pas sous firefox ?
ERREUR: Erreur : whatcache.style has no properties
Fichier Source : [file:///C:/Documents%20and%20Settings/Administrateur/Bureau/test.htm file:///C:/Documents%20and%20Settings/Administrateur/Bureau/test.htm]
Ligne : 19
le code:
<html>
<HEAD>
<title>Cut&Paste Image zoom in/out</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
<!--
var zoomfactor=0.05
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."+what)
prefix=(state=="in")? 1 : -1
if (whatcache.style.width==("")||state=="restore"){ -------------- ligne19
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>
</HEAD>
cs_bultez
Messages postés13615Date d'inscriptionjeudi 13 février 2003StatutMembreDernière intervention15 octobre 201330 20 sept. 2005 à 11:39
bonjour,
déjà :
function zoom(originalW, originalH, what, state){
//if (!document.all&&!document.getElementById)
//return
//whatcache=eval("document."+what)
whatcache=document.getElementById(what);
...
en ajoutant id="myimage" au
il y a 2 name="myimage", ce qui
pourrait poser problème.
et il faut voir le reste.... @+
tropik99
Messages postés2Date d'inscriptionmercredi 28 juillet 2004StatutMembreDernière intervention20 septembre 2005 20 sept. 2005 à 11:59
ok !
donc après vos corrections de code, cela fonctionne !
voiçi le code comple qui fonctionne sous : IE et Firefox.
<html>
<HEAD>
<title>Cut&Paste Image zoom in/out</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
<!--
var zoomfactor=0.05
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=document.getElementById(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>
</HEAD>