Drop Down Menu within a Menu Include Page |
Drop Down Menu within a Menu Include Page |
Jude |
Dec 22 2008, 04:53 AM
Post
#1
|
Group: Members Posts: 3 Joined: 22-December 08 Member No.: 7,383 |
Hi
hope someone can help! I've added the code below into my menu include page and it works ok when in Browser. I now want to add this page as a menu include into my main page but the dropdown menu then doesnt doest work! Is there a bit of code I need to add in my main page to activate the dropdown menu? Code within the head, #popitmenu{ position: absolute; background-color: white; border:1.5px solid black; font: normal 11px arial; line-height: 20px; z-index: 500; visibility: hidden; } #popitmenu a{ text-decoration: none; padding-left: 6px; color: black; display: block; } #popitmenu a:hover{ /*hover background color*/ background-color: lightblue; } #dhtmltooltip{ position: absolute; width: 4500px; border: 1px solid black; padding: 1px; background-color: white; visibility: hidden; z-index: 100; /*Remove below line to remove shadow. Below line should always appear last within this CSS*/ filter: progid:DXImageTransform.Microsoft.Shadow(color=white,direction=135); } </style> <script type="text/javascript"> /*********************************************** * Pop-it menu- © Dynamic Drive (www.dynamicdrive.com) * This notice MUST stay intact for legal use * Visit http://www.dynamicdrive.com/ for full source code ***********************************************/ var defaultMenuWidth="150px" //set default menu width. var linkset=new Array() //SPECIFY MENU SETS AND THEIR LINKS. FOLLOW SYNTAX LAID OUT linkset[1]='<a href="http://"">Title</a>' linkset[1]+='<a href="http://"">Title</a>' ////No need to edit beyond here var ie5=document.all && !window.opera var ns6=document.getElementById if (ie5||ns6) document.write('<div id="popitmenu" onMouseover="clearhidemenu();" onMouseout="dynamichide(event)"></div>') function iecompattest(){ return (document.compatMode && document.compatMode.indexOf("CSS")!=-1)? document.documentElement : document.body } function showmenu(e, which, optWidth){ if (!document.all&&!document.getElementById) return clearhidemenu() menuobj=ie5? document.all.popitmenu : document.getElementById("popitmenu") menuobj.innerHTML=which menuobj.style.width=(typeof optWidth!="undefined")? optWidth : defaultMenuWidth menuobj.contentwidth=menuobj.offsetWidth menuobj.contentheight=menuobj.offsetHeight eventX=ie5? event.clientX : e.clientX eventY=ie5? event.clientY : e.clientY //Find out how close the mouse is to the corner of the window var rightedge=ie5? iecompattest().clientWidth-eventX : window.innerWidth-eventX var bottomedge=ie5? iecompattest().clientHeight-eventY : window.innerHeight-eventY //if the horizontal distance isn't enough to accomodate the width of the context menu if (rightedge<menuobj.contentwidth) //move the horizontal position of the menu to the left by it's width menuobj.style.left=ie5? iecompattest().scrollLeft+eventX-menuobj.contentwidth+"px" : window.pageXOffset+eventX-menuobj.contentwidth+"px" else //position the horizontal position of the menu where the mouse was clicked menuobj.style.left=ie5? iecompattest().scrollLeft+eventX+"px" : window.pageXOffset+eventX+"px" //same concept with the vertical position if (bottomedge<menuobj.contentheight) menuobj.style.top=ie5? iecompattest().scrollTop+eventY-menuobj.contentheight+"px" : window.pageYOffset+eventY-menuobj.contentheight+"px" else menuobj.style.top=ie5? iecompattest().scrollTop+event.clientY+"px" : window.pageYOffset+eventY+"px" menuobj.style.visibility="visible" return false } function contains_ns6(a, b) { //Determines if 1 element in contained in another- by Brainjar.com while (b.parentNode) if ((b = b.parentNode) == a) return true; return false; } function hidemenu(){ if (window.menuobj) menuobj.style.visibility="hidden" } function dynamichide(e){ if (ie5&&!menuobj.contains(e.toElement)) hidemenu() else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget)) hidemenu() } function delayhidemenu(){ delayhide=setTimeout("hidemenu()",500) } function clearhidemenu(){ if (window.delayhide) clearTimeout(delayhide) } if (ie5||ns6) document.onclick=hidemenu </script> </head> Code wihtin the body <a href="#" onMouseover="showmenu(event,linkset[1], '180px')" onMouseout="delayhidemenu()"><font face="Frutiger 55 Roman" size="3" color="#0079C6"><b>Title</b></font></a> Kind Regards Jude |
pandy |
Dec 22 2008, 04:57 AM
Post
#2
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
Well, if you have the above on both pages and it doesn't work on one of them, then what you don't show us is probably part of the problem. URL?
|
Jude |
Dec 22 2008, 05:46 AM
Post
#3
|
Group: Members Posts: 3 Joined: 22-December 08 Member No.: 7,383 |
Hi Paddy
I have only added the code above in one page that’s my include page! My main page has only the HTML for the page table, text etc... do I need to add some code in my main page to activate the code in the menu include page? Hope this makes sense Jude This post has been edited by Jude: Dec 22 2008, 05:46 AM |
Jude |
Dec 22 2008, 08:29 AM
Post
#4
|
Group: Members Posts: 3 Joined: 22-December 08 Member No.: 7,383 |
Forgot to mention that I was unable to add a URL as its an Intranet Site
|
Christian J |
Dec 22 2008, 09:49 AM
Post
#5
|
. Group: WDG Moderators Posts: 9,653 Joined: 10-August 06 Member No.: 7 |
Does both the include file and the main page contain complete HEAD, BODY tags etc? That would cause duplicate tags. Unlike framed pages, an include file should only contain what's missing from the including page.
|
Lo-Fi Version | Time is now: 19th April 2024 - 10:42 PM |