PDA

View Full Version : Tabs Menu (mouseover)



lawofthesnake
06-12-2006, 08:25 PM
http://www.mirrora.com/phpBB2/index.php

What im trying to do is get it so when you hover over lets say community the links do not disappear when moving down

heres the code:


<a href="http://www.thefirstgeneration.com/portal.php" onMouseover="showit(0)">Home</a> :: <a href="http://www.thefirstgeneration.com/index.php" onMouseover="showit(1)">Community</a> :: <a href="http://www.thefirstgeneration.com/profile.php?mode=editprofile" onMouseover="showit(2)">My Stuff</a> :: <a href="http://www.thefirstgeneration.com/portal.php?page=2" onMouseover="showit(3)">Columns</a> :: <a href="http://www.thefirstgeneration.com/portal.php?page=2" onMouseover="showit(4)">Channels</a> :: <a href="http://www.thefirstgeneration.com/portal.php?page=7" onMouseover="showit(5)">Contests</a> :: <a href="http://www.thefirstgeneration.com/activity.php" onMouseover="showit(6)">Games</a>

<!-- Edit the dimensions of the below, plus background color-->
<ilayer width=760 height=700 name="dep1" bgColor="FFFFFF">
<layer name="dep2" width=700 height=500>
</layer>
</ilayer>
<div id="describe" style="background-color:#FFFFFF;width:700px;height:15px" onMouseover="clear_delayhide()" onMouseout="resetit(event)"></div>


<script language="JavaScript1.2">

/*
Tabs Menu (mouseover)- By Dynamic Drive
For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
This credit MUST stay intact for use
*/

var submenu=new Array()

//Set submenu contents. Expand as needed. For each content, make sure everything exists on ONE LINE. Otherwise, there will be JS errors.

submenu[0]='<img src="http://prod-nursing.emory.edu/lccin/images/Design/White-spacer.gif"><font size="2" face="Verdana"><b>Featured Content | Boards | Chat | Stats | Staff | Store</b></font><img src="http://prod-nursing.emory.edu/lccin/images/Design/White-spacer.gif">'

submenu[1]='<img src="http://prod-nursing.emory.edu/lccin/images/Design/White-spacer.gif"><font size="2" face="Verdana"><b>Boards | Blogs | Groups | Members | Photos | Quizzes | Search</b></font><img src="http://prod-nursing.emory.edu/lccin/images/Design/White-spacer.gif">'

submenu[2]='<img src="http://prod-nursing.emory.edu/lccin/images/Design/White-spacer.gif"><font size="2" face="Verdana"><b>Profile | Notes | Friends | Blog CP | Blog | My Photos | My Posts | New Posts</b></font><img src="http://prod-nursing.emory.edu/lccin/images/Design/White-spacer.gif">'

submenu[3]='<img src="http://prod-nursing.emory.edu/lccin/images/Design/White-spacer.gif"><font size="2" face="Verdana"><b>Teen Advice | Suicide | Guys & Girls | Girl Problems | Etc </b></font><img src="http://prod-nursing.emory.edu/lccin/images/Design/White-spacer.gif">'

submenu[4]='<img src="http://prod-nursing.emory.edu/lccin/images/Design/White-spacer.gif"><font size="2" face="Verdana"><b>Arts & Writing | Gamerz Heaven | Music Beet | Movies & TV | News & Issues | Sex & Dating | Video Central</b></font><img src="http://prod-nursing.emory.edu/lccin/images/Design/White-spacer.gif">'

submenu[5]='<img src="http://prod-nursing.emory.edu/lccin/images/Design/White-spacer.gif"><font size="2" face="Verdana"><b>Montly Contests | Medals | Raffles | Free Stuff | Invite People</b></font><img src="http://prod-nursing.emory.edu/lccin/images/Design/White-spacer.gif">'

submenu[6]='<img src="http://prod-nursing.emory.edu/lccin/images/Design/White-spacer.gif"><font size="2" face="Verdana"><b>Games | Gambling | Trophies | Search | Hall of Fame | Modify Settings | Chanllenges | Top Five | My Character</b></font><img src="http://prod-nursing.emory.edu/lccin/images/Design/White-spacer.gif">'

//Set delay before submenu disappears after mouse moves out of it (in milliseconds)
var delay_hide=9999999999999999999999999999999999999999999999999999999999999999999

/////No need to edit beyond here

var menuobj=document.getElementById? document.getElementById("describe") : document.all? document.all.describe : document.layers? document.dep1.document.dep2 : ""

function showit(which){
clear_delayhide()
thecontent=(which==-1)? "" : submenu[which]
if (document.getElementById||document.all)
menuobj.innerHTML=thecontent
else if (document.layers){
menuobj.document.write(thecontent)
menuobj.document.close()
}
}

function resetit(e){
if (document.all&&!menuobj.contains(e.toElement))
delayhide=setTimeout("showit(-1)",delay_hide)
else if (document.getElementById&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhide=setTimeout("showit(-1)",delay_hide)
}

function clear_delayhide(){
if (window.delayhide)
clearTimeout(delayhide)
}

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

ddadmin
06-13-2006, 06:33 AM
If I understood correctly, you can do this just by removing the onMouseover code in:

<div id="describe" style="background-color:#E6E6FF;width:400px;height:32px" onMouseover="clear_delayhide()" onMouseout="resetit(event)" ></div>

Remove the part in red.

lawofthesnake
06-26-2006, 06:01 PM
Ok ive done everything and is working on the beta site at mirrora.com/phpBB2 however when i try to make it work on thefirstgeneration.com it just wont here's the link to all the code:

http://www.thefirstgeneration.com/templates/smilies2/overall_header.tpl

you need to login under test/test as password on tfg and change template to beta to see i thinks.