View Single Post
Old 07-13-2006   #1 (permalink)
ecntrc
A$s On Fiyah
 
ecntrc's Avatar
 
Join Date: May 2005
Location: Ewa Beach, Hawaii
Posts: 601

Send a message via Yahoo to ecntrc
Vertical Menu Problem

I am going to take another shot at this. First Ill explain that my navigation menu is suppose to slide out to the right.. So I decided to try some dynamic drive script. But now it wont even work in FF opera or IE. I have a feeling that I dont know. I really messed it up. Good thing I made a new page for this script. It has html, css and js. the navigation is pushed a little to the right, my iframe is pushed down also. I have no idea what I should do. I keep looking through the code and messing with certain parts thinking it will work.. but im stumped.. I have 2 days now. lol. I need this thing to work!

heres my code CSS & JS first which goes in the head

Code:
<style type="text/css">

#dropmenudiv{
position:relative;
background-color: #ffffff;
border:1px solid black;
border-bottom-width: 0;
font:normal 12px Verdana;
line-height:18px;
z-index:100;
}

#dropmenudiv a{
width: 30px;
display: block;
text-indent: 0px;
border-bottom: 1px solid black;
padding: 0px 0;
text-decoration: none;
font-weight: bold;
}

#dropmenudiv a:hover{ /*hover background color*/
background-color: #ffffff;
}

/* Sample CSS definition for the example list. Remove if desired */
.navlist li {
list-style-type: none;
width: 100px;
background-color: #fffffff;
}

</style>


<script type="text/javascript">

/***********************************************
* AnyLink Vertical Menu- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

//Contents for menu 1
var menu1=new Array()
menu1[0]='<a href="http://www.pacificexpos.com/SpringNewProductsShow.htm">Show Information Page</a>'
menu1[1]='<a href="http://www.pacificexpos.com/BoothInfoSNPS.htm">Booth Information</a>'
menu1[2]='<a href="http://www.pacificexpos.com/SpringShowApp.pdf">Show Contract</a>'
menu1[3]='<a href="http://www.pacificexpos.com/SpecialEventsSNPS.htm">Special Events</a>'
menu1[4]-'<a href="http://wwww.pacificexpos.com/StrongMan.htm">Strong Man Competition</a>'
menu1[5]='<a href="http://www.pacificexpos.com/PicturesSNPS">Pictures</a>'


//Contents for menu 2, and so on
var menu2=new Array()
menu2[0]='<a href="http://www.pacificexpos.com/BetterHome&GardenShow.htm">Show Information Page</a>'
menu2[1]='<a href="http://www.pacificexpos.com/BoothInfoBHGS.htm">Booth Information</a>'
Menu2[2]='<a href="http://www.pacificexpos.com/HomeShowApp.pdf">Show Contract</a>'
menu2[3]='<a href="http://www.pacificexpos.com/SpecialEventsBHGS.htm">Special Events</a>'
menu2[4]='<a href="http://www.pacificexpos.com/PressReleaseBHGS.htm">Press Release</a>'
menu2[5]='<a href="http://www.pacificexpos.com/DiscountCouponBHGS.htm">Discount Coupon</a>'
menu2[6]='<a href="http://www.pacificexpos.com/PicturesBHGS.htm">Pictures</a>'

//Contents for menu 3
var menu3=new Array()
menu3[0]='<a href="http://www.pacificexpos.com/WeddingAffairShow.htm">Show Information Page</a>'
menu3[1]='<a href="http://www.pacificexpos.com/BoothInfoWS.htm">Booth Information</a>'
Menu3[2]='<a href="http://www.pacificexpos.com/WeddingShowApp.pdf">Show Contract</a>'
menu3[3]='<a href="http://www.pacificexpos.com/PicturesWS.htm">Pictures</a>'

//Contents for menu 4
var menu2=new Array()
menu4[0]='<a href="http://www.pacificexpos.com/FoodNewProductsShow.htm">Show Information Page</a>'
menu4[1]='<a href="http://www.pacificexpos.com/BoothInfoFNPS.htm">Booth Information</a>'
Menu4[2]='<a href="http://www.pacificexpos.com/FoodShowApp.pdf">Show Contract</a>'
menu4[3]='<a href="http://www.pacificexpos.com/SpecialEventsFNPS.htm">Special Events</a>'
menu4[4]='<a href="http://www.pacificexpos.com/PicturesFNPS.htm">Pictures</a>'
		
var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var horizontaloffset=2 //horizontal offset of menu from default location. (0-5 is a good value)

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width: 160px" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top=-500
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x-obj.offsetWidth < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure+obj.offsetWidth
}
else{
var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move menu up?
edgeoffset=dropmenuobj.contentmeasure-obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either? (position at top of viewable window then)
edgeoffset=dropmenuobj.y
}
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}


function dropdownmenu(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+obj.offsetWidth+horizontaloffset+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+"px"
}

return clickreturnvalue()
}

function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

</script>
HTML in the body
Code:
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="200" border="2" align="center" cellpadding="2" bordercolor="#000000">
  <tr>
    <td><!-- ImageReady Slices (index.psd) -->
	<table id="Table_01" width="876" height="716" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td rowspan="3">
			<img src="http://forums.biorust.com/images/index_01.jpg" width="195" height="186" alt=""></td>
		<td>
			<img src="http://forums.biorust.com/images/index_02.jpg" width="680" height="93" alt=""></td>
		<td>
			<img src="http://forums.biorust.com/images/spacer.gif" width="1" height="93" alt=""></td>
	</tr>
	<tr>
		<td>
			<img src="http://forums.biorust.com/images/index_03.jpg" width="680" height="79" alt=""></td>
		<td>
			<img src="http://forums.biorust.com/images/spacer.gif" width="1" height="79" alt=""></td>
	</tr>
	<tr>
		<td rowspan="2">
			<img src="http://forums.biorust.com/images/index_04.jpg" width="680" height="22" alt=""></td>
		<td>
			<img src="http://forums.biorust.com/images/spacer.gif" width="1" height="14" alt=""></td>
	</tr>
	<tr>
		<td rowspan="2">
			<img src="http://forums.biorust.com/images/index_05.jpg" width="195" height="21" alt=""></td>
		<td>
			<img src="http://forums.biorust.com/images/spacer.gif" width="1" height="8" alt=""></td>
	</tr>
	<tr>
		<td rowspan="11">&nbsp;
			<iframe src="MainFrame.htm" name="Main" width="680" height="526" scrolling="auto" frameborder="0"></iframe></td>
		<td>
			<img src="http://forums.biorust.com/images/spacer.gif" width="1" height="13" alt=""></td>
	</tr>
	<tr>
		<td>
			<img src="http://forums.biorust.com/images/index_07.jpg" width="195" height="40" alt=""></td>
		<td>
			<img src="http://forums.biorust.com/images/spacer.gif" width="1" height="40" alt=""></td>
	</tr>
	<tr><td>
	<ul class="navlist">
<li class="navlist"><strong><img src="/images/index_08.jpg"></img></strong>
        <ul style="border: 2px solid #000000">
        <li onMouseover="dropdownmenu(this, event, menu1, '50px')" onMouseout="delayhidemenu()"><a href="BoothInfoSNPS.htm">Booth Information</a></li>
        <li onMouseover="dropdownmenu(this, event, menu1, '50px')" onMouseout="delayhidemenu()"><a href="SpringShowAPP.pdf" target="_new">Show Contract (*download)</a></li>
        <li onMouseover="dropdownmenu(this, event, menu1, '50px')" onMouseout="delayhidemenu()"><a href="SpecialEventsSNPS.htm">Special Events</a></li>
        <li onMouseover="dropdownmenu(this, event, menu1, '50px')" onMouseout="delayhidemenu()"><a href="PressReleaseSNPS.htm">Strong Man</a></li>
		<li onMouseover="dropdownmenu(this, event, menu1, '50px')" onMouseout="delayhidemenu()"><a href="PicturesSNPS.htm">Pictures</a></li>
        </ul>
</li>

<li><strong><img src="/images/index_09.jpg"></img></strong>
        <ul style="border: 2px solid #000000">
        <li onMouseover="dropdownmenu(this, event, menu2, '150px')" onMouseout="delayhidemenu()"><a href="BoothInfoBHGS.htm">Booth Information</a></li>
        <li onMouseover="dropdownmenu(this, event, menu2, '150px')" onMouseout="delayhidemenu()"><a href="HomeShowAPP.pdf" target="_blank">Show Contract (*download)</a></li>
        <li onMouseover="dropdownmenu(this, event, menu2, '150px')" onMouseout="delayhidemenu()"><a href="SpecialEventsBHGS.htm">Special Events</a></li>
        <li onMouseover="dropdownmenu(this, event, menu2, '150px')" onMouseout="delayhidemenu()"><a href="PressReleaseBHGS.htm">Press Release</a></li>
		<li onMouseover="dropdownmenu(this, event, menu2, '150px')" onMouseout="delayhidemenu()"><a href="DiscountCoupon.htm">Discount Coupon</a></li>
		<li onMouseover="dropdownmenu(this, event, menu2, '150px')" onMouseout="delayhidemenu()"><a href="PicturesBHGS">Pictures</a></li>
        </ul>
</li>

<li><strong><img src="/images/index_10.jpg"></img></strong>
        <ul style="border: 2px solid #000000">
        <li onMouseover="dropdownmenu(this, event, menu3, '150px')" onMouseout="delayhidemenu()"><a href="BoothInfoWS.htm">Booth Information</a></li>
        <li onMouseover="dropdownmenu(this, event, menu3, '150px')" onMouseout="delayhidemenu()"><a href="WeddingShowAPP.pdf" target="_blank">Show Contract (*download)</a></li>
		<li onMouseover="dropdownmenu(this, event, menu3, '150px')" onMouseout="delayhidemenu()"><a href="PicturesWS.htm">Pictures</a></li>
        </ul>
</li>

<li><strong><img src="/images/index_11.jpg"></img></strong>
        <ul style="border: 2px solid #000000">
        <li onMouseover="dropdownmenu(this, event, menu4, '150px')" onMouseout="delayhidemenu()"><a href="BoothInfoFNPS.htm">Booth Information</a></li>
        <li onMouseover="dropdownmenu(this, event, menu4, '150px')" onMouseout="delayhidemenu()"><a href="FoodShowShowAPP.pdf">Show Contract (*Download)</a></li>
        <li onMouseover="dropdownmenu(this, event, menu4, '150px')" onMouseout="delayhidemenu()"><a href="SpecialEventsFNPS.htm">Special Events</a></li>
		<li onMouseover="dropdownmenu(this, event, menu4, '150px')" onMouseout="delayhidemenu()"><a href="PicturesFNPS.htm">Pictures</a></li>
        </ul>
</li>

<li><strong><a href="http://www.philtradeexpo.com/"><img src="http://forums.biorust.com/images/index_12.jpg" border="0"></img></a></strong></li>
</ul></td></tr>
	<tr>
		<td>
			<a href="http://www.tarachanel.com" target="_blank"><img src="http://forums.biorust.com/images/index_13.jpg" alt="" width="195" height="41" border="0"></a></td>
		<td>
			<img src="http://forums.biorust.com/images/spacer.gif" width="1" height="41" alt=""></td>
	</tr>
	<tr>
		<td>
			<a href="OOTExhibitors.htm" target="Main"><img src="http://forums.biorust.com/images/index_14.jpg" alt="" width="195" height="33" border="0"></a></td>
		<td>
			<img src="http://forums.biorust.com/images/spacer.gif" width="1" height="33" alt=""></td>
	</tr>
	<tr>
		<td>
			<a href="Questionnaire.htm" target="Main"><img src="http://forums.biorust.com/images/index_15.jpg" alt="" width="195" height="28" border="0"></a></td>
		<td>
			<img src="http://forums.biorust.com/images/spacer.gif" width="1" height="28" alt=""></td>
	</tr>
	<tr>
		<td>
			<a href="ContactUs.htm" target="Main"><img src="http://forums.biorust.com/images/index_16.jpg" alt="" width="195" height="40" border="0"></a></td>
		<td>
			<img src="http://forums.biorust.com/images/spacer.gif" width="1" height="40" alt=""></td>
	</tr>
</table>
<!-- End ImageReady Slices --></td>
  </tr>
</table>
</body>
</html>

</body>
</html>
got the script here.. http://www.dynamicdrive.com/dynamici...nkvertical.htm

can anyone.. please help me! im getting a little desperate..
__________________
google is my lover, whos yours?
ecntrc is offline