Position på dropdown
Hej Eksperter.Nu er jeg ved at flå fjæset af mig selv :)
Jeg kan simpelhen ikke få min dropdown menu til at fungere så de står ens i 2 forskellige opløsninger :) håber i kan hjælpe mig :p
Koden består af :)
Index.php
-----------------------
<html>
<head>
<title>asd</title>
<SCRIPT language=javascript src="index/ypSlideOutMenusC.js"></SCRIPT>
<SCRIPT language=javascript src="index/init.js"></SCRIPT>
<link rel="STYLESHEET" type="text/css" href="default.css">
</head>
<BODY onresize=reCalc(); onload=reCalc();>
<SCRIPT language=JavaScript type=text/JavaScript>
var menus = [
new ypSlideOutMenu("menu1", "down", 0, 156, 0, 0),
new ypSlideOutMenu("menu2", "down", 100, 156, 128, 160),
new ypSlideOutMenu("menu3", "down", 200, 156, 128, 160),
new ypSlideOutMenu("menu4", "down", 300, 156, 128, 160)
]
for (var i = 0; i < menus.length; i++) {
menus[i].onactivate = new Function("document.getElementById('act" + i + "').className='active';");
menus[i].ondeactivate = new Function("document.getElementById('act" + i + "').className='';");
}
</SCRIPT>
<table height=100% border="0" cellpadding="0" cellspacing="0">
<tr>
<td align=left valign=middle>
<table width="750" height=100% border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="10">
<img src="images/hk_01.gif" width="750" height="115" alt=""></td>
</tr>
<tr>
<td colspan="2">
<img src="images/hk_02.gif" width="171" height="21" alt=""></td>
<td>
<img src="images/forside1.gif" width="45" height="21" alt="" onMouseOver="this.src='images/forside2.gif'; return true;" onMouseOut="this.src='images/forside1.gif'; return true" border=0></td>
<td>
<DIV id=menu2Container>
<DIV class=menu id=menu2Content>
<DIV class=options><A
href="http://www.visage-cup.dk/index.php?page=info">Generel information</A><BR>
<A
href="http://www.visage-cup.dk/index.php?page=regler">Regler</A><BR>
<A
href="http://www.visage-cup.dk/index.php?page=struktur">Cup struktur</A><BR>
<A
href="http://www.visage-cup.dk/index.php?page=faq">F.A.Q.</A><BR>
<A
href="http://www.visage-cup.dk/index.php?page=sponsorer">Sponsorer/Præmier</A><BR>
<A
href="http://www.visage-cup.dk/index.php?page=kontakt">Kontaktliste</A><BR>
</DIV>
</DIV>
</DIV>
<A id=act1
onmouseover="swapImage('btn2','','images/Omlandsklubben2.gif',1);ypSlideOutMenu.showMenu('menu2')"
onmouseout="swapImgRestore();ypSlideOutMenu.hideMenu('menu2')"
href="http://www.visage-cup.dk/#"><IMG
style="WIDTH: 88px; HEIGHT: 21px"
src="images/Omlandsklubben1.gif" name=btn2></A></td>
<td>
<DIV id=menu3Container>
<DIV class=menu id=menu3Content>
<DIV class=options><A
href="http://www.visage-cup.dk/index.php?page=info">Generel information</A><BR>
<A
href="http://www.visage-cup.dk/index.php?page=regler">Regler</A><BR>
<A
href="http://www.visage-cup.dk/index.php?page=struktur">Cup struktur</A><BR>
<A
href="http://www.visage-cup.dk/index.php?page=faq">F.A.Q.</A><BR>
<A
href="http://www.visage-cup.dk/index.php?page=sponsorer">Sponsorer/Præmier</A><BR>
<A
href="http://www.visage-cup.dk/index.php?page=kontakt">Kontaktliste</A><BR>
</DIV>
</DIV>
</DIV>
<A id=act2
onmouseover="swapImage('btn3','','images/strategi_vision2.gif',1);ypSlideOutMenu.showMenu('menu3')"
onmouseout="swapImgRestore();ypSlideOutMenu.hideMenu('menu3')"
href="http://www.visage-cup.dk/#"><IMG
style="WIDTH: 82px; HEIGHT: 21px"
src="images/strategi_vision1.gif" name=btn3></A></td>
<td>
<DIV id=menu4Container>
<DIV class=menu id=menu4Content>
<DIV class=options><A
href="http://www.visage-cup.dk/index.php?page=info">Generel information</A><BR>
<A
href="http://www.visage-cup.dk/index.php?page=regler">Regler</A><BR>
<A
href="http://www.visage-cup.dk/index.php?page=struktur">Cup struktur</A><BR>
<A
href="http://www.visage-cup.dk/index.php?page=faq">F.A.Q.</A><BR>
<A
href="http://www.visage-cup.dk/index.php?page=sponsorer">Sponsorer/Præmier</A><BR>
<A
href="http://www.visage-cup.dk/index.php?page=kontakt">Kontaktliste</A><BR>
</DIV>
</DIV>
</DIV>
<A id=act3
onmouseover="swapImage('btn4','','images/bestyrelse2.gif',1);ypSlideOutMenu.showMenu('menu4')"
onmouseout="swapImgRestore();ypSlideOutMenu.hideMenu('menu4')"
href="http://www.visage-cup.dk/#"><IMG
style="WIDTH: 59px; HEIGHT: 21px"
src="images/bestyrelse1.gif" name=btn4></A></td>
<td>
<img src="images/overenskomster_aftaler1.gif" width="126" height="21" alt=""></td>
<td>
<img src="images/aktiviteter1.gif" width="60" height="21" alt=""></td>
<td>
<img src="images/kompetenceudvikling1.gif" width="113" height="21" alt=""></td>
<td>
<img src="images/hk_10.gif" width="6" height="21" alt=""></td>
</tr>
<tr>
<td colspan="10">
<img src="images/hk_11.gif" width="750" height="11" alt=""></td>
</tr>
<tr>
<td>
<img src="images/hk_12.gif" width="5" height="232" alt=""></td>
<td background="images/nyheder.gif" width="166" height=100%>
<!-- NYHEDER -->
</td>
<td colspan="7" background="images/content.gif" width="573" height=100% align=center valign=top>
<!-- CONTENT -->
<table width="530" height=100% border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="3">
<img src="images/content_top.gif" width="530" height="43" alt=""></td>
</tr>
<tr>
<td background="images/content_left.gif" width="10" height=100%>
</td>
<td background="images/content_content.gif" width="510" height=100%>
<!-- CONTENT_CONTENT -->
</td>
<td background="images/content_right.gif" width="10" height=>
</td>
</tr>
<tr>
<td colspan="3">
<img src="images/content_bottom.gif" width="530" height="43" alt=""></td>
</tr>
</table>
</td>
<td>
<img src="images/hk_15.gif" width="6" height="232" alt=""></td>
</tr>
<tr>
<td colspan="10">
<img src="images/hk_16.gif" width="750" height="21" alt=""></td>
</tr>
</table>
<td>
<td align=left valign=middle bgcolor="#E0EAF5" width=100% background="images/bg.gif">
</td>
</tr>
</table>
</body>
</html>
---------------------------------
init.js
---------------------------------
<!--
// Preload images
preloadImages('/ill/cc_btn_forside_on.gif','/ill/cc_btn_info_on.gif','/ill/cc_btn_hold_on.gif','/ill/cc_btn_forum_on.gif');
// Menu recalculation function
function reCalc() {
ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false
winW = (ns4)? window.innerWidth-16 : document.body.offsetWidth-20
winH = (ns4)? window.innerHeight : document.body.offsetHeight
if (winW>=800){
mnuX = ((winW-800)/2)+66
} else {
mnuX = 66
}
var oMnu = document.getElementById('menu2Container');
oMnu.style.left = mnuX+106;
var oMnu = document.getElementById('menu3Container');
oMnu.style.left = mnuX+176;
var oMnu = document.getElementById('menu4Container');
oMnu.style.left = mnuX+279;
}
// Courtesy of SimplytheBest.net (http://simplythebest.net/info/dhtml_scripts.html)
function swapImgRestore() {
var i,x,a=document.sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function preloadImages() {
var d=document; if(d.images){ if(!d.p) d.p=new Array();
var i,j=d.p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.p[j]=new Image; d.p[j++].src=a[i];}}
}
function findObj(n, d) {
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=findObj(n,d.layers[i].document);
if(!x && document.getElementById) x=document.getElementById(n); return x;
}
function swapImage() {
var i,j=0,x,a=swapImage.arguments; document.sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=findObj(a[i]))!=null){document.sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function showHideLayers() {
var i,p,v,obj,args=showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=findObj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style ; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
obj.visibility=v; }
}
//-->
___________________________________
Håber meget det kan fikses... :)
