Flytte menu efter scroll
HejsaJeg har en menu som ser sådan her ud:
<%
strpage = lcase((split(request.servervariables("script_name"),"/")(ubound(split(request.servervariables("script_name"),"/")))))
%>
<script language="Javascript">
function overpoint(Fid, Sid){
document.getElementById(Fid).style.fontStyle='italic';
document.getElementById(Fid).style.backgroundColor='#ee8a00';
document.getElementById(Sid).innerHTML='<img src="menuarrow.gif" height="20">';
if (Fid=='m1a'){
document.getElementById('info').innerHTML='Info: Klik her for at komme til forsiden igen...';
}
if (Fid=='m2a'){
document.getElementById('info').innerHTML='Info: Klik her for at se forummet. Stedet hvor du kan spørge Expert Aalborg direkte om hjælp og hurtigt få svar...';
}
if (Fid=='m3a'){
document.getElementById('info').innerHTML='Info: Klik her for at se links til forskellige produkter som findes i Expert...';
}
if (Fid=='m4a'){
document.getElementById('info').innerHTML='Info: Klik her for at se eller ændre din profil...';
}
if (Fid=='m5a'){
document.getElementById('info').innerHTML='Info: Klik her hvis du ønsker at logge ud og dermed forlade Expert-Svar...';
}
}
function outpoint(Fid, Sid){
document.getElementById(Fid).style.fontStyle='normal';
document.getElementById(Fid).style.backgroundColor='#c0c0c0';
document.getElementById(Sid).innerHTML='';
document.getElementById('info').innerHTML='';
}
function gopoint(url){
wait();
document.location=url;
}
</script>
<%
set rs = conn.execute("select lastdato from users where id='" & session("userid") & "'")
Vlastdato = rs("lastdato")
rs.close
set rs=nothing
Olastdato = datediff("s",Vlastdato,now())
Tlastdato = formatnumber((Olastdato/3600),0)
if (Tlastdato*3600)>Olastdato then Tlastdato=Tlastdato-1
if Tlastdato<1 then Tlastdato=0
Mlastdato = formatnumber(((Olastdato/60)-(Tlastdato*60)),0)
if ((Mlastdato*60)-(Tlastdato/60))>Olastdato then Mlastdato=Mlastdato-1
if Mlastdato<1 then Mlastdato=0
Slastdato = formatnumber(((Olastdato)-((Mlastdato*60)+(Tlastdato*3600))),0)
if ((Mlastdato/60)+(Tlastdato/3600))>Olastdato then Slastdato=Slastdato-1
if Slastdato<1 then Slastdato=0
%>
<table cellpadding="0" cellspacing="0" width="100%" style="background-color: #c0c0c0;">
<tr>
<td valign="top" height="100" colspan="2" id="tidbox" style="text-align: center; font-family: Verdana; font-size: 10px; color: #ffffff; font-style: italic; cursor: default;">
</td>
</tr>
<script type="text/JavaScript">
var sec,min,tim;
sec = <%=Slastdato%>;
min = <%=Mlastdato%>;
tim = <%=Tlastdato%>;
function upd(){
sec++;
if (sec == 60){
min++;
sec = 0;
}
if (min == 60){
tim++;
min = 0;
}
if (tim == 60){
tim++;
min = 0;
}
showsec = sec;
if (showsec<10){
showsec = "0" + showsec;
}
showmin = min;
if (showmin<10){
showmin = "0" + showmin;
}
showtim = tim;
if (showtim<10){
showtim = "0" + showtim;
}
document.getElementById('tidBox').innerHTML = "<%=server.htmlencode("Din onlinetid: ")%>" + showtim + ":" + showmin + ":" + showsec;
setTimeout("upd()", 1000);
}
upd();
</script>
<tr>
<td width="80%" height="30"<% if not strpage="main.asp" then%> onclick="gopoint('main.asp');" onmouseover="overpoint('m1a', 'm1b');" onmouseout="outpoint('m1a', 'm1b');"<%end if%> id="m1a" style="background-color: #c0c0c0; text-align: left; font-family: Verdana; font-size: 14px; font-weight: bold;<% if strpage="main.asp" then%>cursor: default; font-style: italic; color: #ee8a00;<%else%>cursor: hand; font-style: normal; color: #ffffff;<%end if%>">
<%=server.htmlencode("Forside")%>
</td>
<td height="30" style="text-align: right; cursor: default;" id="m1b" width="20%">
<% if strpage="main.asp" then%><img src="menuarrow2.gif" height="20"><%end if%>
</td>
</tr>
<tr>
<td width="80%" height="30"<% if not (strpage="forum.asp" or strpage="newask.asp" or strpage="viewq.asp" or strpage="subask.asp") then%> onclick="gopoint('forum.asp');" onmouseover="overpoint('m2a', 'm2b');" onmouseout="outpoint('m2a', 'm2b');"<%end if%> id="m2a" style="background-color: #c0c0c0; text-align: left; font-family: Verdana; font-size: 14px; font-weight: bold;<% if (strpage="forum.asp" or strpage="newask.asp" or strpage="viewq.asp" or strpage="subask.asp") then%>cursor: default; font-style: italic; color: #ee8a00;<%else%>cursor: hand; font-style: normal; color: #ffffff;<%end if%>">
<%=server.htmlencode("Forum")%>
</td>
<td height="30" style="text-align: right; cursor: default;" id="m2b" width="20%">
<% if (strpage="forum.asp" or strpage="newask.asp" or strpage="viewq.asp" or strpage="subask.asp") then%><img src="menuarrow2.gif" height="20"><%end if%>
</td>
</tr>
<tr>
<td width="80%" height="30"<% if not strpage="links.asp" then%> onclick="gopoint('links.asp');" onmouseover="overpoint('m3a', 'm3b');" onmouseout="outpoint('m3a', 'm3b');"<%end if%> id="m3a" style="background-color: #c0c0c0; text-align: left; font-family: Verdana; font-size: 14px; font-weight: bold;<% if strpage="links.asp" then%>cursor: default; font-style: italic; color: #ee8a00;<%else%>cursor: hand; font-style: normal; color: #ffffff;<%end if%>">
<%=server.htmlencode("Nyttige links")%>
</td>
<td height="30" style="text-align: right; cursor: default;" id="m3b" width="20%">
<% if strpage="links.asp" then%><img src="menuarrow2.gif" height="20"><%end if%>
</td>
</tr>
<tr>
<td width="80%" height="30"<% if not (strpage="prof.asp" or strpage="newpass.asp") then%> onclick="gopoint('prof.asp');" onmouseover="overpoint('m4a', 'm4b');" onmouseout="outpoint('m4a', 'm4b');"<%end if%> id="m4a" style="background-color: #c0c0c0; text-align: left; font-family: Verdana; font-size: 14px; font-weight: bold;<% if (strpage="prof.asp" or strpage="newpass.asp") then%>cursor: default; font-style: italic; color: #ee8a00;<%else%>cursor: hand; font-style: normal; color: #ffffff;<%end if%>">
<%=server.htmlencode("Din profil")%>
</td>
<td height="30" style="text-align: right; cursor: default;" id="m4b" width="20%">
<% if (strpage="prof.asp" or strpage="newpass.asp") then%><img src="menuarrow2.gif" height="20"><%end if%>
</td>
</tr>
<tr>
<td width="80%" height="30"<% if not strpage="logout.asp" then%> onclick="gopoint('logout.asp');" onmouseover="overpoint('m5a', 'm5b');" onmouseout="outpoint('m5a', 'm5b');"<%end if%> id="m5a" style="background-color: #c0c0c0; text-align: left; font-family: Verdana; font-size: 14px; font-weight: bold;<% if strpage="logout.asp" then%>cursor: default; font-style: italic; color: #ee8a00;<%else%>cursor: hand; font-style: normal; color: #ffffff;<%end if%>">
<%=server.htmlencode("Log ud")%>
</td>
<td height="30" style="text-align: right; cursor: default;" id="m5b" width="20%">
<% if strpage="logout.asp" then%><img src="menuarrow2.gif" height="20"><%end if%>
</td>
</tr>
<tr>
<td width="100%" height="10" colspan="2"></td>
</tr>
<tr>
<td id="info" colspan="2" width="100%" style="border-top: 4px solid #ffffff; background-color: #c0c0c0; text-align: center; font-family: Verdana; font-size: 10px; color: #ffffff; font-style: italic;">
</td>
</tr>
</table>
Det jeg så gerne vil er at menuen altid skal "flytte" sig efter scrollingen. Dette vil sige at hvis brugeren scroller ned på siden så skal menuen følge med...
Er der nogen her der kan forklare mig på en pædagogisk måde hvordan man skruer det sammen?
\Dan
