CSS Dropdown menu (Full Version)

All Forums >> [Web Development] >> Cascading Style Sheets



Message


erinatkins -> 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




Giomanach -> 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




erinatkins -> RE: CSS Dropdown menu (1/13/2004 11:11:41)

This was the reply I was afraid of. [:'(]

I would love to see this work with CSS in future.




Giomanach -> RE: CSS Dropdown menu (1/13/2004 11:12:57)

quote:

ORIGINAL: erinatkins
I would love to see this work with CSS in future.

I'll play about with it tonight, see if I can make one, and I'll keep going till I do [:D]. I just wanna prove myself wrong really!

Dan




erinatkins -> RE: CSS Dropdown menu (1/13/2004 13:55:48)

quote:

I'll play about with it tonight, see if I can make one, and I'll keep going till I do . I just wanna prove myself wrong really!


Please prove us wrong. [:D] I could live with it - really.[:D]




gorilla -> RE: CSS Dropdown menu (1/13/2004 15:11:26)

quote:

ORIGINAL: Giomanach


1. You need the JavaScript to hide/show the menu items. ..... But the JavaScript is required to hide the menu items.

2. All you can really use CSS for with them is to format the links.

3. Sorry I'm not much use,

Dan


1. Not in fact correct

2. Definitely not in fact correct.

3. Three inaccurate statements in a row - not one of your better posts! [:)]

http://www.evolt.org/article/How_to_make_a_simple_CSS_dropdown_menu/17/52030/

http://www.meyerweb.com/eric/css/edge/menus/demo.html (the start of it all)

Tabs with dropdowns.

http://www.kalsey.com/tools/csstabs/

One with js (lightweight and good)

http://www.alistapart.com/articles/dropdowns

Many of the problems arise from IE's non compliant rendering algorithm. We're working on this one too results are promising even in IE but ooh man (or skating cat) it's hard going.



Mhaircaish




c1sissy -> RE: CSS Dropdown menu (1/13/2004 19:20:33)

quote:

ORIGINAL: gorilla

quote:

ORIGINAL: Giomanach


1. You need the JavaScript to hide/show the menu items. ..... But the JavaScript is required to hide the menu items.

2. All you can really use CSS for with them is to format the links.

3. Sorry I'm not much use,

Dan


1. Not in fact correct

2. Definitely not in fact correct.

3. Three inaccurate statements in a row - not one of your better posts! [:)]

http://www.evolt.org/article/How_to_make_a_simple_CSS_dropdown_menu/17/52030/

http://www.meyerweb.com/eric/css/edge/menus/demo.html (the start of it all)

Tabs with dropdowns.

http://www.kalsey.com/tools/csstabs/

One with js (lightweight and good)

http://www.alistapart.com/articles/dropdowns

Many of the problems arise from IE's non compliant rendering algorithm. We're working on this one too results are promising even in IE but ooh man (or skating cat) it's hard going.



Mhaircaish


Thank you for posting this Mhaircaish. I go away for a while come back and a question is posted that I knew the answer to![;)] I really knew this one!

Of course I am going to check out your links for this as I know that they HAVE to be really good ones!

Thanks again!




Giomanach -> RE: CSS Dropdown menu (1/14/2004 3:44:44)

Hate to say this Mhaircaish but I am right. By drop down list Erin means one like the Global Nav Bar here

I have looked at making one like that with pure CSS, all CSS allows you to do is hide it, not show on hover.

The links that you have given only give a list, not a drop down list. With what I was doing, I got as far as one div tag, with two layers in it. One for the main menu and another for the submenu which appears when you hover on one of the links. JavaScript is required to hide and show the sub menu.

If you can prove me wrong go ahead. But I tried the menus on those links for myself and all I got was a list, with idented links for the submenus [:)]

Dan




erinatkins -> RE: CSS Dropdown menu (1/14/2004 8:33:17)

Mhaircaish & Dan,

Thanks for the link I know I can use something like this in the future. I am trying to learn more CSS & I know at times I have requests for having sub menus.

Those were great links.

Dan is about right what I want. If I have a navigation menu on left & you click on one item - I want it two show a few items under it.

If I can't get a real drop down menu - I will use a list like you have suggested. It could work. [:D]

Thanks again
Erin




Giomanach -> 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>




erinatkins -> RE: CSS Dropdown menu (1/14/2004 8:51:56)

Dan,

Thanks I will play with that some.


Erin




Giomanach -> RE: CSS Dropdown menu (1/14/2004 8:53:51)

Quite Welcome

If you need a hand just email or PM me, I'll answer sooner or later[:D]

Dan

P.S Blame Mom for the CSS addiction, it's makes easy work of websites lol




gorilla -> RE: CSS Dropdown menu (1/14/2004 14:43:39)

quote:

ORIGINAL: Giomanach

Hate to say this Mhaircaish but I am right. By drop down list Erin means one like the Global Nav Bar here

I have looked at making one like that with pure CSS, all CSS allows you to do is hide it, not show on hover.

The links that you have given only give a list, not a drop down list. With what I was doing, I got as far as one div tag, with two layers in it. One for the main menu and another for the submenu which appears when you hover on one of the links. JavaScript is required to hide and show the sub menu.

If you can prove me wrong go ahead. But I tried the menus on those links for myself and all I got was a list, with idented links for the submenus [:)]

Dan


LOL dan you don't know me or you wouldn't say that [:)]

I know exactly what Erin was talking about and I have got pure css dropdowns working. The problem I'm having is getting them compatible crossbrowser. Shouldn't be long now not more than a few weeks (and a few weeks only because attila the hen aaka my rehab person has me worn out. )

I'll post the code when its ready - links above show the current "state of the art" check them in several browsers btw - me I like to push a bit.

Mhaircaish




c1sissy -> RE: CSS Dropdown menu (1/14/2004 15:19:02)

quote:

attila the hen aaka my rehab person has me worn out. )


Send her the definition of PACE [;)]

I was anxiously awaiting the reply to this one, lol.




Giomanach -> RE: CSS Dropdown menu (1/15/2004 5:24:43)

quote:

ORIGINAL: gorilla

LOL dan you don't know me or you wouldn't say that [:)]

I know exactly what Erin was talking about and I have got pure css dropdowns working. The problem I'm having is getting them compatible crossbrowser. Shouldn't be long now not more than a few weeks (and a few weeks only because attila the hen aaka my rehab person has me worn out. )

I'll post the code when its ready - links above show the current "state of the art" check them in several browsers btw - me I like to push a bit.

Mhaircaish


You're right, I don't know you, well not as well as I should [:)] I have tried the CSS Drop Down Menus on the links, I have even put them in Dreamweaver to validate and test the scripts, yet they only give me list, with sub lists, no drop down menus.

And does aaka mean also adversely known as?

I would like to see the pure CSS drop down, with no other scripts in it, but take your time, some one in your position shouldn't be rushing themselves




erinatkins -> RE: CSS Dropdown menu (1/15/2004 8:45:43)

quote:

I know exactly what Erin was talking about and I have got pure css dropdowns working. The problem I'm having is getting them compatible crossbrowser. Shouldn't be long now not more than a few weeks (and a few weeks only because attila the hen aaka my rehab person has me worn out. )

I'll post the code when its ready - links above show the current "state of the art" check them in several browsers btw - me I like to push a bit.



I can't wait to see the code. I will be more than happy to test it for you.[:D][:D]

Erin




gorilla -> RE: CSS Dropdown menu (1/15/2004 15:47:14)

Erin I'll take you up on that!

quote:

ORIGINAL: Giomanach

1. And does aaka mean also adversely known as?

2. I would like to see the pure CSS drop down, with no other scripts in it, but take your time, some one in your position shouldn't be rushing themselves


1. It means that I was typing in a hurry. Also at present I only have use of one hand and that imperfectly.

2. Its the cross browser aspect that's such a pain. What do you mean in my position? Oh I think I see what you mean!

You mean a gorilla who's going to be 44 next birthday walks like frankenstein, and is trying to re-learn how not to, has regrown (YAY!*) his fur, is learning how to use his hands again and anyway is gearing up for our campaign over the next few months with speaking engagements and meetings in:

Stockholm
Helsinki
Prague
Florence
Barcelona
Madrid
Marseilles
Bruges
Dublin
Copenhagen
Brno
Vilnius
Taliin and
Warsaw

over the next few months. You're quite right someone in that position shouldn't be rushing themselves but then the work is important and far too many people having had to do far too much while I was incapable so ............

Mhaircaish

* - There are few sights more horrible than a furless gorilla, believe me I know! [:)][:)][:)]




Giomanach -> RE: CSS Dropdown menu (1/16/2004 3:31:46)

quote:

ORIGINAL: gorilla


1. You mean a gorilla who's going to be 44 next birthday walks like frankenstein, and is trying to re-learn how not to, has regrown (YAY!*) his fur, is learning how to use his hands again and anyway is gearing up for our campaign over the next few months with speaking engagements and meetings in:

2. * - There are few sights more horrible than a furless gorilla, believe me I know! [:)][:)][:)]


1. Something like that

2. I don't wanna know!!!!![:D]

Dan




erinatkins -> RE: CSS Dropdown menu (1/19/2004 15:02:44)

quote:

Erin I'll take you up on that!


I am ready when you are [;)]




skip -> 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?




c1sissy -> 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?




gorilla -> RE: CSS Dropdown menu (2/17/2004 11:13:40)

Erin,

progress report: Oh hang on I've said that elswhere [:D] Anyway nearly there testing the damned thing to destruction and trying to get it s508 and wcag compliant. I think I've got a bug workaround will post more in a while.

I've got it working by dint of cheating. If I can get it compliant as well I'm going to be unbearably pleased as the expert consensus is that it isn't possible. Yes it is. Hah! That'll be one up for us gorillas - just 'cos you guys have got opposable thumbs ..........[:D]




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.140625