Web Design and Development Forums

Drop-down menu solution?

This is a discussion on "Drop-down menu solution?" within the CSS Forum section. This forum, and the thread "Drop-down menu solution? are both part of the Design Your Website category.


Go Back   Webforumz.com > Design Your Website > CSS Forum

Welcome to Webforumz.com.
Register Now Register now!

Reply
 
LinkBack Thread Tools Rate Thread
Old Apr 14th, 2008, 22:36   #1 (permalink)
New Member
 
Join Date: Apr 2008
Location: Earth
Posts: 1
Drop-down menu solution?

Hello. I'm trying to make a drop-down menu based on a hierarchical unordered list system.

This is the code I tried to modify (so that it would work with my code):

Code: Select all
#navigation ul {
    position: absolute;
    top: 101px;
}
#navigation {
    width: 100%;
    background: #eee;
    float: left;
}
#navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    float: left;
}
#navigation a, #navigation h2 {
    font: bold 11px/16px arial, helvetica, sans-serif;
    display: block;
    margin: 0;
    padding: 2px 3px;
}
#navigation h2 {
    color: #fff;
    background: #000;
    text-transform: uppercase;
}
#navigation a {
    height: 25px;
    color: #000;
    background: #9F9F9F;
    text-decoration: none;
}
#navigation a:hover {
    color: #a00;
    background: #fff;
}
#navigation li {
    position: relative;
    margin: 0;
}
#navigation ul ul {
    position: absolute;
    z-index: 500;
    top: 23px;
    width: 200px;
}
#navigation ul ul li {
    width: 100%;
    border: 1px solid #000000;
    margin: 0;
    padding: 0;
}
#navigation ul ul ul {
    top: 0;
    left: 100%;
}
div#navigation ul ul, div#navigation ul li:hover ul ul, div#navigation ul ul li:hover ul ul {
    display: none;
}
div#navigation ul li:hover ul, div#navigation ul ul li:hover ul, div#navigation ul ul ul li:hover ul {
    display: block;
}
<!--[if IE]>
    <style type="text/css" media="screen">
    body {
        behavior: url(csshover.htc);
        font-size: 100%;
    }
    #navigation ul li {
        float: left;
        list-style: none;
    }
    #navigation ul li a {
        height: 1%;
    } 
    #navigation a, #navigation h2 {
        font: bold 0.7em/1.4em arial, helvetica, sans-serif;
    }
    </style>
<![endif]-->
This is all the CSS I have for #navigation:

Code: Select all
#navigation {
    height: 15px;
    background: url(images/nav.png) no-repeat;
}
#navigation ul li {
    float: left;
    list-style: none;
    margin-right: 3px;
}
#navigation ul li a {
    display: block;
    width: 100px;
    padding-top: 15px;
    overflow: hidden !important;
}
#navigation ul .navigation a {
    background: url(images/navigation.png) no-repeat;
}
#navigation ul .bof1 a {
    background: url(images/bof1.png) no-repeat;
}
#navigation ul .bof2 a {
    background: url(images/bof2.png) no-repeat;
}
#navigation ul .bof3 a {
    background: url(images/bof3.png) no-repeat;
}
#navigation ul .bof4 a {
    background: url(images/bof4.png) no-repeat;
}
#navigation ul .bof5 a {
    background: url(images/bof5.png) no-repeat;
}
#navigation ul li ul li {
    display: none;
    width: 200px;
    clear: both;
}
#navigation ul.bof1:hover ul .bof1menu {
    display: block;
    width: 200px;
}
This is my unordered list:

Code: Select all
                <ul>
                    <li class="navigation"><a href="#"></a></li>
                    <li class="bof1"><a href="#"></a></li>
                    <li class="bof2"><a href="#"></a></li>
                    <li class="bof3"><a href="#"></a></li>
                    <li class="bof4"><a href="#"></a></li>
                    <li class="bof5"><a href="#"></a></li>
                </ul>
Anyone know how I can get a drop-down menu to work?
Sanehouse is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Apr 18th, 2008, 12:10   #2 (permalink)
Moderator
 
spinal007's Avatar
 
Join Date: Mar 2004
Location: Good Ol'London
Age: 22
Posts: 1,609
Blog Entries: 1
Send a message via ICQ to spinal007 Send a message via MSN to spinal007 Send a message via Yahoo to spinal007 Send a message via Skype™ to spinal007
Re: Drop-down menu solution?

http://www.htmldog.com/articles/suckerfish/dropdowns/
__________________
Diego - SEO Consultant London (My Blog | Fight Me)
jQuery: Star Rating - Multiple File Upload - FCKEditor/Codepress
Before we work on artificial intelligence why don't we do something about natural stupidity?
spinal007 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Apr 18th, 2008, 16:54   #3 (permalink)
Moderator
 
Join Date: Aug 2005
Location: Texas
Age: 31
Posts: 1,612
Send a message via AIM to moojoo Send a message via MSN to moojoo Send a message via Yahoo to moojoo
Re: Drop-down menu solution?

Not sure suckerfish is the correct solution, as this can be done without the scripting with CSS and .htc file for IE.

Looking at your menu code you have no nested UL so the CSS you wrote can't target anything.

Code: Select all
<div id="nav">
<ul>
<li class="navigation"><a href=""></a>
<ul>
<li><a href=""></a></li>
<li><a href=""></a></li>
<li><a href=""></a></li>
<li><a href=""></a></li>
<li><a href=""></a></li>
</ul>
</li>
<li><a href="">Menu Item 2</a></li>
<li><a href="">Menu Item 3</a></li>
<li><a href="">Menu Item 4</a></li>
</ul>
</div>
Basic CSS:

Code: Select all
#nav ul li ul {
display:none;
}

#nav ul li:hover ul {
display:block;
width:200px;
position:absolute;
left:auto
}
Thats the basics. See if that helps set you on the right track. Also get Whatever:hover for to make it work in IE. the whatever hover htc is well documented and simple to implement.
__________________
Moof! | http://mevans76.com

Last edited by moojoo; Apr 18th, 2008 at 16:56. Reason: Adding link
moojoo is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Apr 18th, 2008, 23:14   #4 (permalink)
Moderator
 
spinal007's Avatar
 
Join Date: Mar 2004
Location: Good Ol'London
Age: 22
Posts: 1,609
Blog Entries: 1
Send a message via ICQ to spinal007 Send a message via MSN to spinal007 Send a message via Yahoo to spinal007 Send a message via Skype™ to spinal007
Re: Drop-down menu solution?

Good reply moojoo, but I can't see how your suggestion differs from suckerfish.
__________________
Diego - SEO Consultant London (My Blog | Fight Me)
jQuery: Star Rating - Multiple File Upload - FCKEditor/Codepress
Before we work on artificial intelligence why don't we do something about natural stupidity?
spinal007 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Apr 19th, 2008, 15:37   #5 (permalink)
Moderator
 
Join Date: Aug 2005
Location: Texas
Age: 31
Posts: 1,612
Send a message via AIM to moojoo Send a message via MSN to moojoo Send a message via Yahoo to moojoo
Re: Drop-down menu solution?

Suckerfish requires javascript which scrubs the source and uses js to manipulate elements. Also utilizing a conditional comment is a better solution than using js browser sniffing as well, which suckerfish also handles via js. At any rate the solution I provided is probably easier and more direct than suckerfish is as well. Not that suckerfish is not a good solution, just think in this case it may be over kill.
__________________
Moof! | http://mevans76.com

Last edited by moojoo; Apr 19th, 2008 at 15:41.
moojoo is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Apr 19th, 2008, 15:39   #6 (permalink)
Chief Moderator
 
aso186's Avatar
 
Join Date: Oct 2007
Location: UK
Posts: 701
Blog Entries: 2
Send a message via Skype™ to aso186
Re: Drop-down menu solution?

.htc is still a scripting file, and will not take effect if the user has Javascript disabled.
__________________

aso186 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Apr 20th, 2008, 14:40   #7 (permalink)
Moderator
 
spinal007's Avatar
 
Join Date: Mar 2004
Location: Good Ol'London
Age: 22
Posts: 1,609
Blog Entries: 1
Send a message via ICQ to spinal007 Send a message via MSN to spinal007 Send a message via Yahoo to spinal007 Send a message via Skype™ to spinal007
Re: Drop-down menu solution?

Popup menus cannot be achieved without any javascript because IE6 does not handle anything:hover. As aso186 said, if javascript is disabled, suckerfish or not, popup menus will not work in IE6. So why the js-phobia?
__________________
Diego - SEO Consultant London (My Blog | Fight Me)
jQuery: Star Rating - Multiple File Upload - FCKEditor/Codepress
Before we work on artificial intelligence why don't we do something about natural stupidity?
spinal007 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Apr 20th, 2008, 21:48   #8 (permalink)
Junior Member
 
Join Date: Apr 2008
Location: uk
Age: 23
Posts: 36
Re: Drop-down menu solution?

cant offer direct help but http://www.cssplay.co.uk have loads of this type of menu, might be worthwhile checking it out?
bonnit is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Apr 22nd, 2008, 12:16   #9 (permalink)
Junior Member
 
Join Date: Apr 2008
Location: BORO
Posts: 10
Re: Drop-down menu solution?

I'll vouch for CSS play's quaility. I've used there stuff a number of times.

All they request is a link back for personal sites or an email to request permission on larger sites.

http://www.cssplay.co.uk/menus/dd_valid.html

The above link is a Cross browser CSS only DD menu.

Hope this helps
dancave is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Apr 23rd, 2008, 14:44   #10 (permalink)
Moderator
 
Join Date: Aug 2005
Location: Texas
Age: 31
Posts: 1,612
Send a message via AIM to moojoo Send a message via MSN to moojoo Send a message via Yahoo to moojoo
Re: Drop-down menu solution?

Quote:
Originally Posted by aso186 View Post
.htc is still a scripting file, and will not take effect if the user has Javascript disabled.
Aso yes, but the htc method is a tad less obtrusive than suckerfish imo. Either way the end result is the same I guess. The menu should function with or without either, and sub links available on sub pages in some form. Simple enough in some no script tags or conditional depending on what you are using.
__________________
Moof! | http://mevans76.com
moojoo is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old May 2nd, 2008, 11:02   #11 (permalink)
New Member
 
Join Date: May 2008
Location: india
Age: 21
Posts: 3
Re: Drop-down menu solution?

Because the drop down menus are written Javascript the links created in the drop down menu are not relative and are therefore not updated when used on an actual page. This is important because the template is stored in a sub folder called template and not with the other HTML pages so the links are always wrong.
bobby12 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
css, drop-down, html, menu

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
I have a normal css menu, but want ot add drop down menu to it multichild CSS Forum 7 Jan 9th, 2007 16:07
css drop down menu IE Kelly26 CSS Forum 3 Mar 27th, 2006 23:59
Drop down menu ... Drysdale HTML Forum 3 Jul 21st, 2005 22:00
help with drop menu makemesick JavaScript Forum 8 Apr 25th, 2005 21:19
drop menu help makemesick JavaScript Forum 2 Apr 23rd, 2005 05:48



Latest Updates

All Points SEO Security Advisory - CHECK YOUR SITE NOW!

Creative Coding :: February 2008

Webforumz is sponsored by: WESH UK Web Hosting
All times are GMT. The time now is 06:10.

Sleep Study Scoring :: Free Bet :: Website Templates :: Online Betting :: Bookmakers :: Funny Quotes :: Internet Recruitment Software :: Microsoft CRM Experts :: Online Casino :: Decorated Christmas Trees :: Midwife Forums :: Football Betting :: Ecommerce Software :: Web Hosting :: Football Stats :: Dry Cleaning Collection :: xtreme wales - extreme clothing :: Apuestas :: Sharepoint Consultants :: Website Optimisation :: Office Clearance London :: Sharepoint Experts :: Sports Betting :: Casino :: Website Templates :: Web Design Development India :: Online Gambling

Powered by: vBulletin Version 3.7, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.
© 2003-2008 Webforumz.com : All Rights Reserved
Search Engine Friendly URLs by vBSEO 3.2.0 RC6


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59