Jump to content

Recommended Posts

I am not 100% sure what you mean... but I will take a guess:

 

Your menu has rollovers, e.g. it has a white background over the text but when the user mouses-over the text the background turns black... however when the user clicks, for example, the News link the news page opens but the menu is just as normal.  You then want it so that if you are on the News page, the news link has a permanent black background?

 

You would need to create a class in CSS for this and do some simple PHP checks to determine which page you are on, if (for example) the url is '?content=news', then your menu should reflect in the code that:

 

if ($content == "news")
{
    echo '<li class="menu_active">News</li>;
}
else
{
    echo '<li class="menu_notactive">News</li>;
}

 

 

This is of course just an example.

 

Is that what you are trying to achieve?

Maybe...

 

You can extract the current URL with location.href and may be able to use document.getElementById.  But you'd probably have to do document.write to load change the class attached to your menu item, which would mean writing <script> tags within other elements, which I do not think is valid (X)HTML.

 

I am not a JavaScript person at all and generally try to avoid it... so it probably is possible.

can anybody help?

 

thanks

 

You re-post / bump after 3 minutes? Are you joking? If you want quick service pay someone. As far as why no one wants to answer your problem, with the exception of jd307, is that you failed to provide any code or any attempts you have tried. If you want to pay someone to do this, post in the freelance section, if you really want "help" to code this, well provide us with some code so we can assist you.

 

But I assure you, your topic is not going to get resolved by not posting code and posting a 1 lined message of what you want to do and expect magic to happen.

 

Is this possible?

Sure it is possible, you just have to do your research on how, do not expect us to do your own research. A tip, googling for "CSS Active State" will bring up some good tutorials / how to's.

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.