Javascript argument non valide div.style.widt
monpseudo
-
monpseudo -
monpseudo -
Bonjour à tous,
Je serais trèèèèèèèèès curieux d'avoir vos avis sur le souci suivant qui me semble peu probable, mais vu que ca fait des jours que je suis dedans, je vois ptet plus rien.
principe: panneaux créés à la volée avec php et identifiés comme il faut, panneaux tous invisibles.
il faut clic sur un lien pour faire apparaitre le panneau correspondant.
pour tester j'ouvre un panneau, puis un autre etc. il y a une fonction qui checke d'abord si il n'y en pas un ouvert, le ferme et ouvre celui que j'ai demandé. Ca foire sous IE. les quelques premiers clics tout va bien et puis boum.
Code HTML des liens :
dans le JS, la ligne incriminée est celle où j'affecte une width/height calculée au panel
Code JS
est-ce que qqun a une idée ?
pour etre bien sur, que j'ai pas "pas vu" qqe chose, je vous met le JS en entier si ca aide.
Merci d'avance!! :)
bonne journée
Je serais trèèèèèèèèès curieux d'avoir vos avis sur le souci suivant qui me semble peu probable, mais vu que ca fait des jours que je suis dedans, je vois ptet plus rien.
principe: panneaux créés à la volée avec php et identifiés comme il faut, panneaux tous invisibles.
il faut clic sur un lien pour faire apparaitre le panneau correspondant.
pour tester j'ouvre un panneau, puis un autre etc. il y a une fonction qui checke d'abord si il n'y en pas un ouvert, le ferme et ouvre celui que j'ai demandé. Ca foire sous IE. les quelques premiers clics tout va bien et puis boum.
Code HTML des liens :
<a href="javascript void setControl('1', size)">lien qui lance le js</a>"
dans le JS, la ligne incriminée est celle où j'affecte une width/height calculée au panel
Code JS
var panel = documentGetElementbyId("machinchose"); var width = Math.round(//resultat d'un calcul); var height = //resultat d'un calcul // QUE JE ROUND OU PAS CA GENERE l'ERREUR. panel.style.width = width // ou bien width+"px"; //ICICICICICICICIC
est-ce que qqun a une idée ?
pour etre bien sur, que j'ai pas "pas vu" qqe chose, je vous met le JS en entier si ca aide.
Merci d'avance!! :)
bonne journée
function setControl(which, size) { // gets the control button //var control = document.getElementById("control_"+which); //if (!control) { // return false; //} // gets the control panel //var tableau = document.getElementById("content"); if (checkAll(size)){ var panel = document.getElementById("panel_"+which); if (!panel) { return false; } // show panel if (panel.style.display != "block") { //panel.style.display = "block"; //panel.text.display="none"; //panel.style.color = "#000000"; fadePanel1(which, true, size); //alert("GO"+panel.style.height+"-"+panel.style.width); //alert (panel.counter); // hide panel } else { //tableau.style.display = "none"; //panel.style.display ="none"; showText(which, false, size); //fadePanel1(which, false); // tableau.style.display = "block"; } } return true; } function checkAll(size){ for ( var i=0; i < 51; i++ ){ var panel = document.getElementById("panel_"+i); if (panel){ if (panel.style.display != "none"){ showText(i, false, size); } } } return true; } // fade in delay for panel to appear, default is 10 var fadein_speed = 4; // fade out delay for panel to hide, default is 5 var fadeout_speed = 4; // smoothness of fade, lower is better, but it consumes more CPU // default is 20 refreshes per second var refresh_rate = 20; /** * Animated fade of a control panel * * For the counter : 0 = hidden, 100 = shown. Pay attention to IE which is * almost twice slower... * * @param string which * @param boolean show * @return boolean true */ function showText(which, show, size){ var panel = document.getElementById("panelin_"+which); // gets the control panel // alert(panel.style.height+"-"+panel.style.width); if (!panel) { return false; } // clear any existing timeout, so you can click very quickly on the same // control button, the panel will move from current position if (panel.timeout) { clearTimeout(panel.timeout); } // always dispay the panel while moving panel.style.display = "block"; if (!panel.counter) { panel.counter = 0; } // maximum offset for moving the panel var max = 664; // get actual counter, so the position of the panel in the fade var opacity = panel.counter; // avoid flicker when opacity changes to 100% if (opacity >= 100) opacity = 100; else if (opacity <= 0) opacity = 0; panel.style.MozOpacity = (opacity / 100); panel.style.filter = "Alpha(opacity="+(3 * opacity / 4)+")"; // panel is fading in if (show) { // end of fade if (panel.counter >= 99) { return true; } // increment counter panel.counter += fadein_speed; // panel is fading out } else { // end of fade, hide the panel if (panel.counter <= 0) { //panel.counter = 99; fadePanel2(which, false, size) panel.style.display = "none"; return true; } // decrement counter panel.counter -= fadeout_speed; } // recursive call panel.timeout = setTimeout("showText('"+which+"', "+show+", "+size+");", refresh_rate); return true; } function fadePanel1(which, show, size) { // gets the control panel var panel = document.getElementById("panel_"+which); // alert(panel.style.height+"-"+panel.style.width); if (!panel) { return false; } // clear any existing timeout, so you can click very quickly on the same // control button, the panel will move from current position if (panel.timeout) { clearTimeout(panel.timeout); } // always dispay the panel while moving panel.style.display = "block"; if (!panel.counter) { panel.counter = 0; } // maximum offset for moving the panel var max = 664; // get actual counter, so the position of the panel in the fade var opacity = panel.counter; // avoid flicker when opacity changes to 100% if (opacity >= 50) opacity = 50; else if (opacity <= 0) opacity = 0; panel.style.MozOpacity = (opacity / 100); panel.style.filter = "Alpha(opacity="+(3 * opacity / 4)+")"; // sets the next position //var left = - Math.pow(panel.counter - 100, 10) / Math.pow(55, 10); var height = (panel.counter * size)/100; //panel.style.left = left+"px"; //panel.style.color= "#000000"; panel.style.height = height+"px"; panel.style.width = "1px"; panel.style.margin = "auto"; // panel is fading in if (show) { // end of fade if (panel.counter >= 99) { panel.counter = 0 ; fadePanel2(which, true, size); return true; } // increment counter panel.counter += fadein_speed; // panel is fading out } else { // end of fade, hide the panel if (panel.counter <= 0) { panel.style.display = "none"; return true; } // decrement counter panel.counter -= fadeout_speed; } // recursive call panel.timeout = setTimeout("fadePanel1('"+which+"', "+show+", "+size+");", refresh_rate); return true; } function fadePanel2(which, show, size) { // gets the control panel var panel = document.getElementById("panel_"+which); //alert(panel.style.height+"-"+panel.style.width); if (!panel) { return false; } // clear any existing timeout, so you can click very quickly on the same // control button, the panel will move from current position if (panel.timeout) { clearTimeout(panel.timeout); } // always dispay the panel while moving panel.style.display = "block"; if (!panel.counter) { panel.counter = 0; } // maximum offset for moving the panel // get actual counter, so the position of the panel in the fade var opacity = panel.counter; // avoid flicker when opacity changes to 100% if (opacity >= 100) opacity = 99; else if (opacity <= 50) opacity = 50; panel.style.MozOpacity = (opacity / 100); panel.style.filter = "Alpha(opacity="+(3 * opacity / 4)+")"; var width = Math.round((panel.counter * 664)/100); panel.style.width= width; panel.style.margin = "auto"; // panel is fading in if (show) { // end of fade if (panel.counter >= 99) { //panel.text.display="block"; showText(which, true); //panel.style.display = "block"; return true; } // increment counter panel.counter += fadein_speed; // panel is fading out } else { // end of fade, hide the panel if (panel.counter <= 0) { panel.counter = 99; fadePanel1(which, false, size); //panel.style.display = "none"; return true; } // decrement counter panel.counter -= fadeout_speed; } // recursive call panel.timeout = setTimeout("fadePanel2('"+which+"', "+show+", "+size+");", refresh_rate); return true; }
A voir également:
- Javascript argument non valide div.style.widt
- Ethernet n'a pas de configuration ip valide - Guide
- Url valide - Guide
- A javascript error occurred in the main process - Forum Matériel & Système
- Telecharger javascript - Télécharger - Langages
- Le nom du champ de tableau croisé dynamique n'est pas valide ✓ - Forum Excel
3 réponses
Utilise ce site pour copier tes longs codes.
Pour commencer ton lien est invalide. Voici comment faire :
Pour commencer ton lien est invalide. Voici comment faire :
<a href="#" onclick="setControl('1', size); return false;">Lien</a>Après, la console d'erreurs de Firefox t'aidera beaucoup (Ctrl+Maj+J)
Tu dois faire comme ça : element.style.height = taille + 'px';
il me semble que c'est comme ca que j'ai fait ... regarde le code...
à moins que les espaces compte ...
est-ce que
element.style.height = taile+"px"; <> element.style.height = taile+'px';
ou encore <> de element.style.height = taile + "px"; ou <> de element.style.height = taille + 'px';
tu vois ce que je veux dire?
en tous cas, meme si c'est pas ça, vraiment merci de prendre le temps de me répondre :)
à moins que les espaces compte ...
est-ce que
element.style.height = taile+"px"; <> element.style.height = taile+'px';
ou encore <> de element.style.height = taile + "px"; ou <> de element.style.height = taille + 'px';
tu vois ce que je veux dire?
en tous cas, meme si c'est pas ça, vraiment merci de prendre le temps de me répondre :)
pour la console aussi merci, cela dit ... je ne comprends pas ce qu'elle me chante.
"erreur d'analyse de la valeur pour "height". déclaration abandonnée. "
et cet avertissement, est venu aussi après quelques clics.
est-ce qu'il se peut qu'il y ait interférence entre les memes fonctions appelées par des clics différents mais utilisées +/- simultanément ...?