cs_destiny
Messages postés249Date d'inscriptionjeudi 17 février 2005StatutMembreDernière intervention29 août 2011
-
3 nov. 2007 à 13:01
cs_destiny
Messages postés249Date d'inscriptionjeudi 17 février 2005StatutMembreDernière intervention29 août 2011
-
3 nov. 2007 à 13:33
Bonjour,
Le code :
//Affiche le live TV
function LiveTV(height, width) {
if (livetvwin) {
livetvwin.close();
}
var widthSup = 0;
var heightSup = 0;
if (navigator.appName=='Microsoft Internet Explorer') {
widthSup = 4;
heightSup = 6;
}
var livetvwin=dhtmlwindow.open("winLiveTv", "iframe", "live_tv.php?w="
+ width + "&h=" + height, "Live RACE24H > TV", "width=" +
(width+widthSup) + "px,height=" + (height + heightSup) +
"px,resize=0,scrolling=1,center=1", "recal")
}
//Affiche l'historique
function historic() {
var
histowin=dhtmlwindow.open("winHisto", "iframe",
"http://www.gtr-online.com/modules/GTROnline/live/enduro/stathistoric.php?gameid=3",
"Live RACE24H > Historique",
"width=590px,height=365px,resize=1,scrolling=1,center=1", "recal")
}
//Affiche l'historique
function option() {
var
optionwin=dhtmlwindow.open("winOption", "iframe", "live_option.php",
"Live RACE24H > Option",
"width=590px,height=365px,resize=1,scrolling=1,center=1", "recal")
}
//Affiche la map
function trackMap(type) {
var
mapwin=dhtmlwindow.open("winMap", "iframe", "map.htm", "Live RACE24H
> Track Map",
"width=590px,height=365px,resize=1,scrolling=1,center=1", "recal")
}
//Affiche les infos server
function info(type) {
var
infowin=dhtmlwindow.open("winInfo", "iframe", "info.htm", "Live RACE24H
> Info", "width=590px,height=365px,resize=1,scrolling=1,center=1",
"recal")
}
//Predef 1
function predef1(type) {
//optionwin.hide();
if (type == "r1024") {
LiveTV(500, 500);
trackMap('server1');
livetvwin.moveTo(1, 1);
mapwin.moveTo(540, 1);
} else {
LiveTV(500, 500);
trackMap('server1');
}
}
Donc, le probléme et assez simple. Quand je lance la function
predef1
, je lance le functions
LiveTV(500, 500); trackMap('server1');
qui 2 element window. a ce moment tout est ok, sauf que quand je fais
livetvwin.moveTo(1, 1); mapwin.moveTo(540, 1);
, il me dit "
livetvwin & mapwin is not defined
" alors qui sont crée ...
Vous pouvez tester mon script ICI . Cliquez sur option, puis sur le lien "1024x768". vous verez bien les 2 window ce créer et l'erreur JS qui suis
Merci d'avance, j'ai essayé 15 000 trucs, rien n'y fais ! Il ne connais pas ces objets pourtant creer.
cs_destiny
Messages postés249Date d'inscriptionjeudi 17 février 2005StatutMembreDernière intervention29 août 2011 3 nov. 2007 à 13:33
J'ai trouver d'ou venai le probléme, quand on créer un element DHTML Window, ca variable n'est pas global mais propre a la function, donc un return de sa variable suffit pour l'utiliser par la suite !