View Full Version : Subglobal links
Mafachu
02-23-2004, 07:01 PM
I am using a default template in Dreamweaver. At first, when you hovered over a link it would display more below. Somehow I managed to change it to where they don't appear when you hover anymore....what did I do????
we wont be able to help you unless you provide some code
please post the link here
Mafachu
02-23-2004, 08:55 PM
oh right sry. I haven't uploaded the page yet. but here's the first part of the code. It wouldn't let me paste the entire thing. If you need the rest let me know and I'll paste it. In case you're wondering, i'm using a style sheet with this and I can post it if u need it. Just let me know!;)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- DW6 -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Video Games</title>
<link rel="stylesheet" href="emx_nav_left.css" type="text/css">
<script type="text/javascript">
<!--
var time = 3000;
var numofitems = 7;
//menu constructor
function menu(allitems,thisitem,startstate){
callname= "gl"+thisitem;
divname="subglobal"+thisitem;
this.numberofmenuitems = 7;
this.caller = document.getElementById(callname);
this.thediv = document.getElementById(divname);
this.thediv.style.visibility = startstate;
}
//menu methods
function ehandler(event,theobj){
for (var i=1; i<= theobj.numberofmenuitems; i++){
var shutdiv =eval( "menuitem"+i+".thediv");
shutdiv.style.visibility="hidden";
}
theobj.thediv.style.visibility="visible";
}
function closesubnav(event){
if ((event.clientY <48)||(event.clientY > 107)){
for (var i=1; i<= numofitems; i++){
var shutdiv =eval('menuitem'+i+'.thediv');
shutdiv.style.visibility='hidden';
}
}
}
// -->
</script>
<style type="text/css">
<!--
.style1 {font-family: "Frutiger Linotype", "Eras Demi ITC", "Lucida Sans Unicode"}
.style4 {
font-size: 125%;
font-weight: bold;
}
.style5 {color: #ffffff}
-->
</style>
</head>
<body onmousemove="closesubnav(event);">
<div class="skipLinks">skip to: <a href="#content">page content</a> | <a href="pageNav">links on this page</a> | <a href="#globalNav">site navigation</a> | <a href="#siteInfo">footer (site information)</a> </div>
<div id="masthead">
<h1 id="siteName"><span class="style1"><img src="cmbanner.gif" alt="SE banner" width="412" height="53"></span></h1>
<div id="utility">
<a href="contact.html">Contact Us</a> |<span class="style5"><a href="http|//www.gamesprint.netfirms.com/cgi-bin/mail.cgi">Newsletter</a></span> |
</div>
<div id="globalNav">
<img alt="" src="gblnav_left.gif" height="32" width="4" id="gnl"> <img alt="" src="glbnav_right.gif" height="32" width="4" id="gnr">
<div id="globalLink"><a href="copy of indexcoolalready!.html" id="gl2" class="glink" onmouseover="ehandler(event,menuitem2);">Home</a><a href="http://www.gamesprint.board.dk3.com/2/" id="gl3" class="glink" onmouseover="ehandler(event,menuitem3);">Forums</a><a href="Videogames.html" id="gl4" class="glink" onmouseover="ehandler(event,menuitem4);">Video Games</a><a href="#" id="gl5" class="glink" onmouseover="ehandler(event,menuitem5);">global link</a><a href="#" id="gl6" class="glink" onmouseover="ehandler(event,menuitem6);">global link</a><a href="#" id="gl7" class="glink" onmouseover="ehandler(event,menuitem7);">Music</a>
</div>
<!--end globalLinks-->
<form id="search" action="">
<input name="searchFor" type="text" size="10">
<a href="">search</a>
</form>
</div>
<BR><!-- end globalNav -->
<BR><div id="subglobal1" class="subglobalNav">
<a href="#">subglobal1 link</a> | <a href="#">subglobal1 link</a> | <a href="#">subglobal1
link</a> | <a href="#">subglobal1 link</a> | <a href="#">subglobal1 link</a> | <a href="#">subglobal1
link</a> | <a href="#">subglobal1 link</a>
</div>
<div id="subglobal2" class="subglobalNav">
<a href="">GCN</a> | <a href="#">subglobal2 link</a> | <a href="#">subglobal2
link</a> | <a href="#">subglobal2 link</a> | <a href="#">subglobal2 link</a> | <a href="#">subglobal2
link</a> | <a href="#">subglobal2 link</a>
</div>
<div id="subglobal3" class="subglobalNav">
<a href="#">subglobal3 link</a> | <a href="#">subglobal3 link</a> | <a href="#">subglobal3
link</a> | <a href="#">subglobal3 link</a> | <a href="#">subglobal3 link</a> | <a href="#">subglobal3
link</a> | <a href="#">subglobal3 link</a>
</div>
<div id="subglobal4" class="subglobalNav">
<a href="#">subglobal4 link</a> | <a href="#">subglobal4 link</a> | <a href="#">subglobal4
link</a> | <a href="#">subglobal4 link</a> | <a href="#">subglobal4 link</a> | <a href="#">subglobal4
link</a> | <a href="#">subglobal4 link</a>
</div>
<div id="subglobal5" class="subglobalNav">
<a href="#">subglobal5 link</a> | <a href="#">subglobal5 link</a> | <a href="#">subglobal5
link</a> | <a href="#">subglobal5 link</a> | <a href="#">subglobal5 link</a> | <a href="#">subglobal5
link</a> | <a href="#">subglobal5 link</a>
</div>
<div id="subglobal6" class="subglobalNav">
<a href="#">subglobal6 link</a> | <a href="#">subglobal6 link</a> | <a href="#">subglobal6
link</a> | <a href="#">subglobal6 link</a> | <a href="#">subglobal6 link</a> | <a href="#">subglobal6
link</a> | <a href="#">subglobal6 link</a>
</div>
<div id="subglobal7" class="subglobalNav">
<a href="#">subglobal7 link</a> | <a href="#">subglobal7 link</a> | <a href="#">subglobal7
link</a> | <a href="#">subglobal7 link</a> | <a href="#">subglobal7 link</a> | <a href="#">subglobal7
link</a> | <a href="#">subglobal7 link</a>
</div>
<div id="subglobal8" class="subglobalNav">
<a href="#">subglobal link</a> | <a href="#">subglobal8 link</a> | <a href="#">subglobal8
link</a> | <a href="#">subglobal8 link</a> | <a href="#">subglobal8 link</a> | <a href="#">subglobal8
link</a> | <a href="#">subglobal8 link</a>
</div>
</div>
<!-- end masthead -->
<div id="pagecell1">
<!--pagecell1-->
<img alt="" src="tl_curve_white.gif" height="6" width="6" id="tl"> <img alt="" src="tr_curve_white.gif" height="6" width="6" id="tr">
<div id="breadCrumb">
</div>
<div id="pageName">
<h2>Video Games </h2>
<img alt="small logo" src="" height="59" width="66"/>
</div>
<div id="pageNav">
<div id="sectionLinks">
<a href="#">Metroid: Zerio MissionFinal Fantasy: Crystal Chronicles </a> <a href="cardrev.html">PSO: C.A.R.D. Revolution</a> <a href="#">Section
Link</a>
</div>
<div class="relatedLinks">
<h3>Related Links </h3>
<a href="fomtwt.txt">FOMT Walkthrough</a> <a href="#">Walkthrough</a></div>
<div class="relatedLinks">
<h3>Related Link Category</h3>
<a href="#">Related Link</a> <a href="#">Related Link</a> <a href="#">Related
Link</a> <a href="#">Related Link</a> <a href="#">Related Link</a> <a href="#">Related
Link</a>
</div>
<div id="advert">
<img src="" alt="" width="107" height="66" /> Advertisement copy goes here.
Advertisement copy goes here.
</div>
</div>
TeHpHoBiA
02-23-2004, 08:58 PM
Since your previous code seems rather long, and there's still more plus the stylesheet -- and maybe even images, why don't you zip all the files and attach them in your next post. ;)
Mafachu
02-23-2004, 09:28 PM
Good idea. I decided just to go ahead and upload everything. I haven't really done much content-wise, but you'll be able to see what I'm talkinbg about. Try clicking on Video games or Contact Us. The "subglobal" links won't appear anymore!here...
http://www.gamesprint.netfirms.com/Videogames.html
When I hover over "Video Games" or "Music" subglobal links should appear, but they dont'. I know they're there though its in the code. There you go!
The style sheet is attached.
agent002
02-24-2004, 05:55 AM
Attached where?
Mafachu
02-24-2004, 06:12 PM
How do I attach it?
Willy Duitt
02-24-2004, 07:18 PM
Heh fellas;
If you have your script debugger on, watch it if you click on the O/P's link (http://www.gamesprint.netfirms.com/Videogames.html)! I got hung up on error alerts being thrown as fast as I could close them. I barely escaped by closing the window thru my Task Manager but it took all my open windows with it. :(
FWIW: The error is on line 61. menuitem1 is undefined. The problem stems from something wrong with your use of eval.
.....Willy
BTW: To attach a file use the Browse button right above the Submit button when you go to post.
Mafachu
02-24-2004, 08:13 PM
Thanks Willy! THe only problem is that I don't know how to correct this problem since I didn't even make the template. Could you help again? THanks !!!!!
Willy Duitt
02-24-2004, 08:50 PM
It looks like you tried to add two seperate codes together and you have lost or misnamed many of your variables. A quick look shows that not only is menuitem undefined but numberofmenuitems changes names from function to function.
I'm sorry I can't help you debug any further. Not only do I detest Dreamweaver scripts, but I would not use nor recommend the use of eval for what should be a relatively simple show/hide script.
Anyway, below is the relavent codes:
35: <script type="text/javascript">
36: <!--
37: var time = 3000;
38: var numofitems = 7;
39:
40: //menu constructor
41: function menu(allitems,thisitem,startstate){
42: callname= "gl"+thisitem;
43: divname="subglobal"+thisitem;
44: this.numberofmenuitems = 7;
45: this.caller = document.getElementById(callname);
46: this.thediv = document.getElementById(divname);
47: this.thediv.style.visibility = startstate;
48: }
49:
50: //menu methods
51: function ehandler(event,theobj){
52: for (var i=1; i<= theobj.numberofmenuitems; i++){
53: var shutdiv =eval( "menuitem"+i+".thediv");
54: shutdiv.style.visibility="hidden";
55: }
56: theobj.thediv.style.visibility="visible";
57: }
58:
59: function closesubnav(event){
60: if ((event.clientY <48)||(event.clientY > 107)){
61: for (var i=1; i<= numofitems; i++){
62: var shutdiv =eval('menuitem'+i+'.thediv');
63: shutdiv.style.visibility='hidden';
64: }
65: }
66: }
67: // -->
68: </script>
89: <div id="globalLink">
<a href="copy of indexcoolalready!.html" id="gl2" class="glink" onmouseover="ehandler(event,menuitem2);">Home</a>
Good Luck;
.....Willy
Willy Duitt
02-24-2004, 08:53 PM
FWIW: Attached is a copy of a menu I would think is very simular to yours that I just redid for someone else. Perhaps it will be of some use to you.
....Willy
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.