Forums / Templates, Stylesheets, Page Layout / Navigation button in the "active" state

Navigation button in the "active" state

Locked

Views: 1,968

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
22 Aug 2007, 5:56 PM
#1
kyates avatar

kyates

New Zenner

Join Date:
May 2005
Posts:
23
Plugin Contributions:
0

Navigation button in the "active" state

Cick question that i'm sure is somewhere in the css (but i'm rubbish with CSS).

My site is at http://85.92.72.76/index.php?main_page=index&cPath=18_29 and this deep link is to a page of ski boots. You'll see that when I roll over the navigation on the left, the "over" state is set to a different colour.

What I want is the button to change to a different colour if the visitor is in that category, which i'm sure is called the active state.

Any clues?

I can provide code if I know which file it is.

Thanks

Kristian

I'm reading the book, but i'm stuck :(

22 Aug 2007, 11:19 PM
#2
rstevenson avatar

rstevenson

Totally Zenned

Join Date:
Nov 2006
Location:
Dartmouth, NS Canada
Posts:
2,400
Plugin Contributions:
0

Re: Navigation button in the "active" state

Hi,

Nope, active means what the button looks like when it is being clicked.

You want the page to be aware of where it is when it's rendered by the browser so that the button of the current page has a different colour, right? That can't be done using CSS. There are javascript solutions or hard coding. The latter won't work on a generated-on-demand site like a shopping cart, so you'll need to explore the JS solution.

I wouldn't be surprised if someone has already done this within a Zen Cart site, so I'll have to wait for others to chime in. I'd certainly be interested myself in such a feature.

Rob

Breakfast: the most important donut of the day.

22 Aug 2007, 11:35 PM
#3
rstevenson avatar

rstevenson

Totally Zenned

Join Date:
Nov 2006
Location:
Dartmouth, NS Canada
Posts:
2,400
Plugin Contributions:
0

Re: Navigation button in the "active" state

And now let me correct myself! :oops:

What I said was generally true of the web, but Zen Cart has a nice feature which may, with some effort, give you what you want.

Zen Cart has the ability to use a unique stylesheet for each category. You just give the stylesheet a custom name: for example. for a category called Shoes, name this extra stylesheet c_shoes.css (It may need to be c_Shoes.css. I can't recall if case sensitivity is required or not.)

In that extra stylesheet put just the style change you need for that category. Of course to do what you want you'll have to find a way to refer uniquely to the particular button you want to give a different colour. In the stock Zen Cart you can't do that. But with some mucking around in the source code to add a unique id to each category, it should be possible.

Good luck! (I'm going to do some thinking on this too, so I may be back with more later.) :frusty:

Rob

Breakfast: the most important donut of the day.