Submit Your Article Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Code > HTML, XHTML and CSS

Reply
 
LinkBack Thread Tools
Old April 8th, 2007, 11:53 PM   #1
New Member
 

Join Date: Oct 2006
Location: uranus
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 camcool21 is on a distinguished road
question about a type of css menu

I have a question about how to create the type of navigation menu that http://www.digg.com uses. The categories are "Technology" "Science"
"World & Business" "Sports" "Entertainment" and "Gaming". And a pointer specifies which menu you have currently selected. Now when you click on a topic and you are taken to the next page, the navigation menu has changed and below it, are categories within the category you selected, and the category within the category that you are currently in is also specified by an arrow. Now I have been searching for how to recreate such an effect and have come up empty...I was wondering if anyone here would be kind enough to explain or point me in the direction of a helpful tutorial...

http://www.dynamicdrive.com/style/cs...css-tabs-menu/
~that is an example of one already made, but I wanna learn how it works and create my own

http://www.dynamicdrive.com/dynamicindex1/ddtabmenu.htm
~also something similar...


I've noticed, with the dynamicdrive.com examples, that javascript is used, I do not believe digg uses javascript. Is there a way to achieve this effect only using css? In basic terms, I wanna learn how to create a navigation menu, that tells the user what category they are currently in...with a submenu directly below it that also tells the user what subcategory they are currently in...help please?

EDIT: http://design.linkworth.com/test.html
~~~Just found that site, and that is exactly the effect I want to create.....I don't want the hover feature that is used here tho...

Last edited by camcool21; April 9th, 2007 at 12:01 AM..
camcool21 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 April 9th, 2007, 06:36 AM   #2
Elite Veteran
 
Ryan Fait's Avatar
 

Join Date: May 2006
Location: Las Vegas
Posts: 3,784
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Ryan Fait is a jewel in the rough Ryan Fait is a jewel in the rough Ryan Fait is a jewel in the rough Ryan Fait is a jewel in the rough
Re: question about a type of css menu

Just use a background image of an upwards pointing arrow on the selected item. You would be able to use nested lists here, so you'll have something more like:

Code:
<div class="topmenu">
  <ul>
    <li>Tech</li>
    <li class="showArrow">Sci</li>
  </ul>
</div>
<div class="secnav">
  <ul>
    <li>This</li>
    <li>And that</li>
  </ul>
</div>
Ryan Fait 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 April 9th, 2007, 11:32 AM   #3
Highly Reputable Member
 
masonbarge's Avatar
 

Join Date: Jan 2006
Location: Atlanta GA
Posts: 649
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 masonbarge will become famous soon enough
Re: question about a type of css menu

1. You could actually do nested lists using css -- You have to display the submenus using pseudo-classes and a bag of tricks.

I did it once for fun, but it was hugely difficult to get it right cross-browser, and was unwieldy and balky even when it worked -- it's more a parlor trick than a working method of page building. It's absurd given the power of javascript. If I saved the file somewhere I'll post it here when I find it.

I got the framework from that woman who did the box hack for IE 5.5. I'm sure it's on the search engines if you want to look.

2. What Ryan said. If you have static html, just put a different menu on each page.

3. I do the effect with PHP. You give each page an internal name (or you could use the page title, it's just that a new variable means cleaner-looking code; I use $b = a short description like "p1" or "index"). Then I do "if" clauses for each page name in the header include. It's a bit bulky but runs fast and is rock-solid stable. You can do anything you want to with the header.

Here's an example. The classes may be a little odd, as you have to allow for differences in the left or rightmost list items. I've put in x's - the "xx" class changes the colors of a top row item and puts a red dot on the item that looks like a little red LED; "xx" does the same thing on a dropdown (aka flyout) item. The "bm2" is a negative bottom margin adjustment to fix gaps in IE7.
Code:
<ul>  // this is the main navigation list
// first, a filler graphic
                    <li class="xxx"><img src="http://www.webforumz.com/images/nav_filler2.gif" 
                    height="19" width="229" alt="interactive health bar graphic" />
                    </li>
// next, a top-level entry with no dropdown
                    <li
                        <?php        if ($b == 'index')    {
                                         echo ' class="xx"><img
 src="./images/redarrowleft.gif" class="redarrow" width="5" height="5"
 alt="arrow to health" />Index';
                                    } else {
                                         echo '><a href="./index.php">Index</a>';
                                    }
                        ?>
                    </li>
// another top level entry, but this one has a dropdown list       
                     <li
                        <?php        if ($b == 'foo')    {
                                         echo ' class="xx"><img
 src="./images/redarrowleft.gif" class="redarrow" width="5" height="5"
 alt="arrow to health" /> Foo';
                                    } else {
                                         echo '><a href="./foo.php">Foo</a> ';
                                    }
                        ?>
// here's the dropdown list, a second ul with css "ul li ul", "ul li ul li.__", "ul li
 ul li a:whatever", etc
                        <ul>
                            <li
                                <?php        if ($b == 'bar')    {
                                                 echo ' class="x bm2"><img
 src="./images/redarrowleft.gif" class="redarrow" width="5" height="5"
 alt="arrow to health" />Bar';
                                            } else {
                                                 echo ' class="bm2"><a href="./foobar.php">
Bar</a> ';
                                            }
                                ?>
                            </li>

Last edited by masonbarge; April 9th, 2007 at 12:09 PM..
masonbarge 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 April 9th, 2007, 11:48 AM   #4
New Member
 

Join Date: Oct 2006
Location: uranus
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 camcool21 is on a distinguished road
Re: question about a type of css menu

thx guys, I'm just gonna use javascript then I guess


thx for the help
camcool21 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

Bookmarks

Tags
menu , digg , css


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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
Drop Down Menu Question dawg9 How is this done? 10 February 10th, 2007 04:51 AM
How do I do this (menu question)? Kokie How is this done? 1 February 6th, 2007 06:00 PM
input type=submit - beginner's question mmdesign HTML, XHTML and CSS 18 August 11th, 2006 01:19 PM
menu/list width question swiftmed HTML, XHTML and CSS 3 May 19th, 2006 09:05 AM
Menu Question... xKillswitchx JavaScript 1 June 20th, 2005 04:46 PM


Search Engine Optimization by vBSEO 3.2.0 RC8