CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 30th, 2013, 02:32 PM
Dianajo Dianajo is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2013
Posts: 4 Dianajo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 42 m 38 sec
Reputation Power: 0
CSS Image Menu - How to Have Button default to "down" if on that page

I'm not exactly sure the best way to phrase this (and it is possible I will need jQuery or some such other to accomplish this). I searched for CSS navigation and didn't see any threads which answered.

Recreating a menu that was hard coded per page.
Buttons have 2 states, normal and hover/down.

If you are on the home page, the button is 'down', all others are normal. If you're on About, the about button is 'down', all others are normal.

I think I'm going to use this one image method to recreate the buttons (and get rid of the DW pre-loader originally used).

Code:
http://www.wellstyled.com/css-nopreload-rollovers.html


Is there a way via CSS (or JS?) to tell the button to be in the down state if the url matches X?

The menu has already been converted to the typical horizontal <li> .

Reply With Quote
  #2  
Old January 30th, 2013, 03:53 PM
rdoyle720 rdoyle720 is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Dec 2003
Posts: 648 rdoyle720 User rank is Major (30000 - 40000 Reputation Level)rdoyle720 User rank is Major (30000 - 40000 Reputation Level)rdoyle720 User rank is Major (30000 - 40000 Reputation Level)rdoyle720 User rank is Major (30000 - 40000 Reputation Level)rdoyle720 User rank is Major (30000 - 40000 Reputation Level)rdoyle720 User rank is Major (30000 - 40000 Reputation Level)rdoyle720 User rank is Major (30000 - 40000 Reputation Level)rdoyle720 User rank is Major (30000 - 40000 Reputation Level)rdoyle720 User rank is Major (30000 - 40000 Reputation Level)rdoyle720 User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 2 Weeks 3 Days 17 h 33 m 51 sec
Reputation Power: 400
CSS can't read the url, but there are lots of ways to do this sort of thing via CSS or other means. One CSS only way is to give each menu item an id and then set an id on the body tag, i.e.

Code:
<body id="home">

CSS:
#home #homeLink {background: green} /* sets menu id "homeLink" background on home page */


If you have a lot of menu items this can get tedious because you need a new line of code for each menu item.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > CSS Image Menu - How to Have Button default to "down" if on that page

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap