|
| |
|
|
erinatkins
Posts: 3072 From: Mechanicsville VA USA Status: offline
|
CSS Dropdown menu - 1/13/2004 10:36:06
Hi All. I have been able to do a basic CSS navigation menu on left. Is it possible to do a CSS drop down menu without java? I have not seen one when I have searched on web. Thanks Erin
_____________________________
All Hail Great Spooky - Master of the Outfront Forums. He can make you or break you.
|
|
|
|
Giomanach
Posts: 6075 Joined: 11/19/2003 From: England Status: offline
|
RE: CSS Dropdown menu - 1/13/2004 10:38:16
quote:
ORIGINAL: erinatkins Hi All. I have been able to do a basic CSS navigation menu on left. Is it possible to do a CSS drop down menu without java? I have not seen one when I have searched on web. Thanks Erin Hi Erin Your not the only one who's been looking for it. You need the JavaScript to hide/show the menu items. If I find a way I will let you know. But the JavaScript is required to hide the menu items. All you can really use CSS for with them is to format the links. Sorry I'm not much use, Dan
_____________________________
|
|
|
|
Giomanach
Posts: 6075 Joined: 11/19/2003 From: England Status: offline
|
RE: CSS Dropdown menu - 1/14/2004 8:46:38
Heres the JavaScript and Coding for my Global Nav on my guides4all site: JavaScript (in <head>)
<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>
JavaScript (at the end of the <body>)
<script type="text/javascript">
<!--
var menuitem1 = new menu(7,1,"hidden");
var menuitem2 = new menu(7,2,"hidden");
var menuitem3 = new menu(7,3,"hidden");
var menuitem4 = new menu(7,4,"hidden");
var menuitem5 = new menu(7,5,"hidden");
var menuitem6 = new menu(7,6,"hidden");
var menuitem7 = new menu(7,7,"hidden");
// -->
</script>
The Divs etc are like so:
<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="index.html" id="gl1" class="glink" onmouseover="ehandler(event,menuitem1);">Home</a><a href="internet%5Cindex.html" id="gl2" class="glink" onmouseover="ehandler(event,menuitem2);">Internet</a><a href="office%5Cindex.html" id="gl3" class="glink" onmouseover="ehandler(event,menuitem3);">Office</a><a href="adobe%5Cindex.html" id="gl4" class="glink" onmouseover="ehandler(event,menuitem4);">Adobe</a><a href="psp%5Cindex.html" id="gl5" class="glink" onmouseover="ehandler(event,menuitem5);">PSP</a><a href="hardware%5Cindex.html" id="gl6" class="glink" onmouseover="ehandler(event,menuitem6);">Hardware</a><a href="win%5Cindex.html" id="gl7" class="glink" onmouseover="ehandler(event,menuitem7);">Windows</a>
</div>
<!--end globalLinks-->
</div>
<!-- end globalNav -->
<div id="subglobal1" class="subglobalNav"> </div>
<div id="subglobal2" class="subglobalNav">
<a href="internet%5Cie%5Cindex.html">Internet Explorer</a> | <a href="internet%5Cweb%5Cindex.html">Web Design</a> | <a href="internet%5Cwhat">What Is The Internet?</a> | <a href="internet\fp\index.html">Frontpage</a> | <a href="internet\dw\index.html">Dreamweaver</a>
</div>
<div id="subglobal3" class="subglobalNav">
<a href="office%5Cword%5Cindex.html">Word</a> | <a href="office%5Cexcel%5Cindex.html">Excel</a> | <a href="office%5Caccess%5Cindex.html">Access</a> | <a href="office%5Cppt%5Cindex.html">Powerpoint</a> | <a href="office%5Coutlook%5Cindex.html">Outlook</a> |
</div>
<div id="subglobal4" class="subglobalNav">
<a href="#">Acrobat</a> | <a href="#">Photoshop</a> </div>
<div id="subglobal5" class="subglobalNav"><a href="psp%5Cpsp7%5Cindex.html">PSP7</a> | <a href="psp%5Cpsp8%5Cindex.html">PSP8</a>
</div>
<div id="subglobal6" class="subglobalNav">
<a href="hardware%5Cbasics.htm">Basics</a> | <a href="hardware%5Cparts.htm">The Parts</a> | <a href="hardware%5Cbuild.htm">Building Your Own</a> | <a href="hardware%5Cproblems.htm">Problems</a> </div>
<div id="subglobal7" class="subglobalNav"><a href="win%5Cwin31%5Cindex.html">Windows 3.1</a> | <a href="win%5Cwin9xme%5Cindex.html">Windows 9x/Me</a> | <a href="win%5Cwin2k%5Cindex.html">Windows 2000</a> | <a href="win%5Cwinxp%5Cindex.html">Windows XP</a> </div>
<div id="subglobal8" class="subglobalNav">
<a href="#">Windows 3.1</a> | <a href="#">WIndows 9x/Me</a> | <a href="#">WIndows 2000</a> | <a href="#">Windows XP</a></div>
</div>
I've just copied straight from my site. You can make the CSS to what ever you want. That should work, It does for me Have Fun Dan <edit> Nearly forgot, you need this as your body tag for it to work (oops)
<body onmousemove="closesubnav(event);">
Memory like a seive </edit>
< Message edited by Giomanach -- 1/14/2004 13:56:39 >
_____________________________
|
|
|
|
erinatkins
Posts: 3072 From: Mechanicsville VA USA Status: offline
|
RE: CSS Dropdown menu - 1/14/2004 8:51:56
Dan, Thanks I will play with that some. Erin
< Message edited by erinatkins -- 1/14/2004 8:52:08 >
_____________________________
All Hail Great Spooky - Master of the Outfront Forums. He can make you or break you.
|
|
|
|
skip
Posts: 171 Joined: 12/9/2001 From: Missouri USA Status: offline
|
RE: CSS Dropdown menu - 1/19/2004 18:40:34
c1sissy quote:
I really knew this one! do you have some info on this topic?
_____________________________
skip www.mathewsremodeling.com
|
|
|
|
c1sissy
Posts: 5079 Joined: 7/20/2002 From: NJ Status: offline
|
RE: CSS Dropdown menu - 1/19/2004 18:46:55
quote:
ORIGINAL: skip c1sissy quote:
I really knew this one! do you have some info on this topic? How soon do you need it? lol, my mind is spining, let me know what you are looking for. check out the links that Mhaircaish placed above, they have good info. I have not done these yet, though am planing on playing with them, but I have read about them. Eric Meyers is a great site to go to for something like this one. In case you have not really noticed, most of my replies are with links as it helps me to learn by helping others. Soemtimes i know the answers and others I know I have read it, but not tried it yet. If that makes sense?
_____________________________
Deb-aka-c4Ksissy high panjandurum and alpha female of the silverback tribe As decreed by Jesper 5-24-2003. The only stupid question is... the one that is never asked!! http://directory.css-styling.com http://fmsforum.com http://positioniseverything.net/ http://www.tanfa.co.uk/
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|