petit pb de syntaxe... [JAVASCRIPT] - Programmation
Marsh Posté le 21-05-2001 à 09:42:46
function DestroyMenu(s)   
{ 
if (iex)   
  { 
  document.all(s).style.top=0; 
  document.all(s).style.left=0; 
  document.all(s).style.visibility="hidden"; 
  } 
}
Marsh Posté le 21-05-2001 à 21:00:40
Ca marches po !!! 
J'ai tout essayé... 
Comprends pas  
 
 
Je vous donne le script entier : Please HELP!!! 
 
 
// <!-- Debut script 
 
function CreateMenu()  
 { 
 if (screen.width < 1023)  
 	{ 
 	var contextfl = 25; 
 	}  
 else  
 	{ 
 	var contextfl = 150; 
 	} 
 if (screen.height < 799)  
 	{ 
 	var contextfh = 25; 
 	}  
 else  
 	{ 
 	var contextfh = 25; 
 	} 
 if (iex&&window.print)  
 	{ 
 	test = document.body.scrollLeft+event.clientX+contextml+10; 
 	maxi = screen.width - contextml - contextfl; 
 	if (test < maxi)  
   { 
   Souris.style.pixelLeft=document.body.scrollLeft+event.clientX+10; 
   } 
 	else  
   { 
   Souris.style.pixelLeft=document.body.scrollLeft+event.clientX-contextml-10; 
   } 
 	test2 = document.body.scrollTop+event.clientY+contextmh+10; 
 	maxi2 = screen.height - contextmh - contextfh; 
 	if (test2 < maxi2)  
   { 
   Souris.style.pixelTop=document.body.scrollTop+event.clientY+10; 
   } 
 	else  
   { 
   Souris.style.pixelTop=document.body.scrollTop+event.clientY-contextmh-10; 
   } 
 	Souris.style.visibility="visible"; 
 	return false 
 	} 
 } 
 
function DestroyMenu()  
 { 
 if (iex)  
 	{ 
 	Souris.style.pixelTop=0; 
 	Souris.style.pixelLeft=0; 
 	Souris.style.visibility="hidden"; 
 	} 
 
 } 
 
 
var contextml = 160; 
var contextmh = 170; 
var Contextid = "Souris"; 
var nav = navigator.appName == "Netscape"; 
var iex = navigator.appName != "Netscape"; 
if (document.all)  
 { 
 document.oncontextmenu=CreateMenu; 
 document.onclick=DestroyMenu; 
 } 
 
//  Fin script -->
Marsh Posté le 21-05-2001 à 21:02:28
Dans l'etat ci dessus il marche ! 
 
Ca sert a faire apparaitre un menu : 
 
<div id="Souris"> ... </div>
Marsh Posté le 21-05-2001 à 00:56:37
Bonjour,
Dans la fonction suivante je voudrais pouvoir passer le "Souris" en parametre pour pouvoir l'appeler comme ca :
DestroyMenu("Souris" )
et j'arrive pas à le lui faire prendre en parametre...
function DestroyMenu()
{
if (iex)
{
Souris.style.pixelTop=0;
Souris.style.pixelLeft=0;
Souris.style.visibility="hidden";
}
}
Merci d'avance
A+
Fiz