Bonjour,
J'ai créé un menu dynamique. J'ai réussi à placer le
menu où je veux mais je n'arrive pas à bien placer les
sous-menus.
dans la page ou j'affiche le menu, j'ai:
<!--#include file="menuFR.asp"-->
et dans menuFR.asp:
<script language="_JavaScript">
posYmenu = 210;
bgcolor='#FF9900';
bgcolor2='#FFFFCC';
posXmenu = 130;
document.write('<style type="text/css">');
document.write('.poppervert { POSITION: absolute;
VISIBILITY: hidden; z-index:3; }');
document.write('#topgauche { position:relative;
top:'+posYmenu+'px; left:'+posXmenu+'px; z-index:10;
}');
document.write('A:hover.ejsmenu {color:#000000;
text-decoration:none;}');
document.write('A.ejsmenu {color:#000000;
text-decoration:none;}');
document.write('</style>');
document.write('<DIV class=poppervert id=topdeckvert
style="position: absolute"></DIV>');
var zlien = new Array;
/*
LIENS
*/
<%
set rs=conn_master.execute("select
num_univers,lbl_univers from UNIVERS")
i=0
while not rs.eof
set rs2=conn_master.execute("select
lbl_categorie_web, num_univ_cat from
CATEGORIE_WEB,UNIVERS_CATEGORIE where
CATEGORIE_WEB.num_categorie_web=UNIVERS_CATEGORIE.num_categ
orie_web and UNIVERS_CATEGORIE.num_univers=" &
rs("num_univers"))
if not rs2.eof then
Response.Write("zlien[" & i & "] = new Array;")
end if
j=0
while not rs2.eof
response.write("zlien[" & i & "][" & j & "] =""<A
HREF='listeProduitsFR.asp?univ_cat=" &
rs2("num_univ_cat") & "&langue=1&archive=0'
CLASS=ejsmenu methods='get'>" &
trim(rs2("lbl_categorie_web")) & "</A>"";")
j=j+1
rs2.movenext
wend
rs2.close
i=i+1
rs.movenext
wend
rs.close
%>
var nava = (document.layers);
var dom = (document.getElementById);
var iex = (document.all);
if (nava) { sknvert = document.topdeckvert}
else if (dom) { sknvert =
document.getElementById("topdeckvert").style};
else if (iex) { sknvert = topdeckvert.style};
sknvert.left = posXmenu+105;
function pop(msg,pos)
{
sknvert.visibility = "hidden";
sknvert.top = posYmenu+pos;
a=true;
var content ="<TABLE BORDER=0 CELLPADDING=0
CELLSPACING=0 BGCOLOR=#000000 WIDTH=150><TR><TD><TABLE
WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=1>";
pass = 0;
while (pass < msg.length)
{
content += "<TR><TD BGCOLOR="+bgcolor+"
onfiltered=\"this.style.background='"+bgcolor2+"'\"
onfiltered=\"this.style.background='"+bgcolor+"'\"
HEIGHT=20><FONT SIZE=1
FACE=\"Verdana\"> "+msg[pass]+"</FONT></TD></TR>
";
pass++;
}
content += "</TABLE></TD></TR></TABLE>";
if (nava)
{
sknvert.document.write(content);
sknvert.document.close();
sknvert.visibility = "visible";
}
else if (dom)
{
document.getElementById("topdeckvert").innerHTML
= content;
sknvert.visibility = "visible";
}
else if (iex)
{
document.all("topdeckvert").innerHTML = content;
sknvert.visibility = "visible";
}
}
function kill()
{
sknvert.visibility = "hidden";
}
document.onfiltered= kill;
document.write("<DIV><TABLE BORDER=0 CELLPADDING=0
CELLSPACING=0 BGCOLOR=#000000 WIDTH=100><TR><TD><TABLE
id=oDiv CELLPADING=0 CELLSPACING=1 BORDER=0 WIDTH=100%
HEIGHT=25>");
<%
set rs=conn_master.execute("select
num_univers,lbl_univers from UNIVERS")
i=0
j=1
rs.movefirst
while not rs.eof
response.write("document.write(""<TR><TD WIDTH=100
ALIGN=center BGCOLOR="" + bgcolor + ""
onfiltered='this.style.background=\'"" + bgcolor2 +
""\';pop(zlien[" & i & "]," & j & "+25)'
onfiltered='this.style.background=\'"" + bgcolor +
""\';' HEIGHT=25><A onfiltered='return(false)'
onfiltered='pop(zlien[" & i & "]," & j & "+25)'
href=# CLASS=ejsmenu><FONT SIZE=1 FACE='Verdana'>" &
trim(rs("lbl_univers")) & "</FONT></a></TD></TR>"");")
i=i+1
j=j+25
rs.movenext
wend
rs.close
%>
document.write('</TABLE></TD></TR></TABLE></DIV>');
</script>