Je dois mettre un site à jour et je n'y connais rien au js hors le menu du site est en js. je dois rajouter des pages dans les menus existant. il y a deux fichiers attachés pour cela: un 1er qui est du chinois pour moi (js):
/*DHTML Menu version 3.0 (beta)
* written by Andy Woolley
* Copyright 2001 Andy Woolley. All Rights Reserved.
* This script featured on Dynamic Drive (http://www.dynamicdrive.com)
*/
timer=0;d=document
smc=-1;
ns4=(d.layers)?true:false
ns6=(navigator.userAgent.indexOf("Gecko")!=-1)?true:false
mac=(navigator.appVersion.indexOf("Mac")!=-1)?true:false
if(ns6)mac=false
opera=(navigator.userAgent.indexOf("Opera")!=-1)?true:false
ns61=(parseInt(navigator.productSub)>=20010726)?true:false
ie4=(!d.getElementById&&d.all)?true:false;
konq=(navigator.userAgent.indexOf("Konqueror")!=-1)?true:false
mp=(ns6)?"pointer":"hand";atop=5;oatop=0;aleft=0;oaleft=1
var a,am,oa,im,om,flta;hlarr=new Array();hlcnt=0;hll=0
timo=0;el=0;nshl=0;var omv=0;df=1;im=0;ofrac=0;omnu=0;ac=15;m=1
var imar=new Array();mr=","
while(eval("window.menu"+m)){mr+="menu"+m+",";tmenu=eval("menu"+m);m++};mr=mr+" ";mr=mr.split("\,");menus=mr.length-1;bgt="";if(!opera)bgt="Color"
function gmobj(mtxt){if(d.getElementById){m=d.getElementById(mtxt)}else if(d.all){m=d.all[mtxt]}else if(d.layers){m=d.layers.eval(mtxt)}return m}
function gmstyle(mtxt){m=gmobj(mtxt);if(!ns4){m=m.style;}return m;}
function spos(gm,t_,l_,h_,w_){if(ns4){gms=gm;if(w_)gms.clip.width=w_;if(h_)gms.clip.height=h_;}else if(opera){gms=gm.style;if(w_)gms.pixelWidth=w_;if(h_)gms.pixelHeight=h_}else{gms=gm.style;if(w_)gms.width=w_;if(h_)gms.height=h_;}if(t_)gms.top=t_;if(l_)gms.left=l_}
function gpos(gm){if(ns4){t_=gm.top;l_=gm.left;h_=gm.clip.height;w_=gm.clip.width;}else if(opera){t_=gm.style.pixelTop;l_=gm.style.pixelLeft;h_=gm.style.pixelHeight;w_=gm.style.pixelWidth;}else if(ns6){t_=gm.offsetTop;l_=gm.offsetLeft;h_=gm.offsetHeight;w_=gm.offsetWidth}else{t_=gm.offsetTop;l_=gm.offsetLeft;h_=gm.offsetHeight;w_=gm.offsetWidth;}if(konq){w_=parseInt(gm.style.width);h_=parseInt(gm.style.height);}var gpa=new Array();gpa[0]=t_;gpa[1]=l_;gpa[2]=h_;gpa[3]=w_;return(gpa)}
function close_el(){for(xa=hlarr.length-1;xa>=0;xa--){ti=hlarr[xa].split("-");tmenu=eval("menu"+ti[0]);if(ns4){shl(ti[0]-1,ti[1],'hide');}else{arg=gmobj("el"+ti[1]);arg.style.backgroundColor="#"+tmenu[5][1];if(opera)arg.style.background="#"+tmenu[5][1];arg.style.color="#"+tmenu[5][0];}if("menu"+ti[0]==hll){if(ns4)shl(ti[0]-1,hel,'show');return}}hlcnt=0;hlarr=new Array()}
function closeallmenus(){om=0;if(ns4){omv.visibility="hide"}for(a=1;a<menus;a++){menu=eval("menu"+a);mi=gmstyle("menu"+a);if (menu[6]!=1){mi.visibility='hidden'}else{am=""}}hll="";close_el();}
function rep_img(){if(timo){timo.src=o_img}}
function popdn()
{
arg=popdn.arguments;
if(arg[0])
{
menu=eval(window.arg[2]);
mnum=arg[2].substr(4,4);
if(arg[3].substr(0,5)!="show-")
{
if(!ns4)
{
if(arg[1]==smc&&menu[5][14])
{
menu[5][0]=menu[5][14];
menu[5][1]=menu[5][15];
}
arg[0].style.backgroundColor="#"+menu[5][1];
if(opera)arg[0].style.background="#"+menu[5][1];
arg[0].style.color="#"+menu[5][0]
}
if(arg[1]==smc&&menu[5][14])
{
menu[5][0]=ofc;
menu[5][1]=obc;
}
}
else
{
if(ns4)omv=0;
hlarr[hlcnt]=mnum+"-"+arg[1];
hlcnt++;
}
}
if(!menu[11])timer=setTimeout("closeallmenus()",timegap)
}
function openwin(url)
{
nwin=window.open(url, "nwin",config="scrollbars=yes,resizable=yes,toolbar=yes,location=yes,status=yes,menubar=yes,");
nwin.focus();
}
prop1=[ // prop1 is an array of properties you can have as many property arrays as you need
"ffffff", // Off Font Color
"6E8CD7", // Off Back Color
"ffffff", // On Font Color
"4361AC", // On Back Color
"ffffff", // Border Color
10, // Font Size
"normal", // Font Style
"bold", // Font Weight
"Verdana,Tahoma,Helvetica", // Font
6, // Padding
, // Sub Menu Image
0, // 3D Border & Separator
"000000", // 3D High Color
"000000", // 3D Low Color
"", // Referer item Font Color (leave this blank to disable)
"", // Referer item Back Color (leave this blank to disable)
]
menu1=[ // This is the array that contains your menu properties and details
98, // Top
0, // left
156, // Width
0, // Border Width
"left", // Screen Position - here you can use "center;middle;right"
prop1, // Properties Array - this is set higher up, as above
1, // Always Visible - allows the menu item to be visible at all time
"center", // Alignment - sets the menu elements alignment, HTML values are valid here for example: left, right or center
, // Filter - Text variable for setting transitional effects on menu activation
0, // Follow Scrolling - Tells the menu item to follow the user down the screen
1, // Horizontal Menu - Tells the menu to be horizontal instead of top to bottom style
, // Keep Alive - Keeps the menu visible until the user moves over another menu or clicks elsewhere on the page
, // Position of sub image left:center:right:middle:top:bottom
, // Show an image on top menu bars indicating a sub menu exists below
, // Reserved for future use
// "Description Text", "URL", "Alternate URL", "Status", "Separator Bar"
"Le concept","show-menu2",,"Le concept",1,
"Les secteurs de lavage","show-menu3",,"Les secteurs de lavage",1,
"Les Produits","show-menu4",,"Les Produits",1,
"Monter votre affaire","show-menu5",,"Monter votre affaire",1,
"Contactez-nous","write-us.html",,"Contactez-nous",1
]
menu2=[
,,185,1,"",prop1,,"left",effect,,,,,,,
"Concept et historique","concept.html",,,1,
"Comment laver sans eau","comment.html",,,1,
"Film","film.html",,,1,
"Partenariat dans les parkings","partenariat.html",,,1
]
menu4=[,,165,1,,prop1,,"left",effect,0,,,,,,
"Grand public","grd.html",,,1,
"Professionnelle","professionnelle.html",,,1,
"Conseils","conseils.html",,,1,
"Distribution/licence","distribution.html",,,1,
"Autres produits","autres-produits.html",,,1
]
menu5=[
,,165,1,"",prop1,,"",effect,,,,,,,
"Pourquoi la franchise","votre-affaire.html",,,1,
"Franchise fixe","franchise-fixe.html",,,1,
"Franchise mobile","franchise-mobile.html",,,1,
"Franchise pro","franchise-pro.html",,,1,
"Franchise multi secteurs","franchise-multi-secteurs.html",,,1,
"Master franchise","master-franchise.html",,,1
]
si je rajoute une ligne dans le menu 2, 3, 4 ou 5 plus rien ne s'affiche donc je me dit qu'il doit y avoir quelque chose dans le premier js à modifier ...
si quelqu'un peut m'aider franchement j'aprecierrais beaucoup.
Michda
pfffffff je n'avais pas vu que la derniere ligne avais un "," en moins et c'est celle là que j'avais copiée collée... le nul!
bon ben je suis pas sur le site du zero pour rien moi au moins....
merci quand même et pour ceux que ça interresse, je laise les pages de code...
Help, menu JS
× Après avoir cliqué sur "Répondre" vous serez invité à vous connecter pour que votre message soit publié.
× Attention, ce sujet est très ancien. Le déterrer n'est pas forcément approprié. Nous te conseillons de créer un nouveau sujet pour poser ta question.