Log in

View Full Version : Difficult CSS/Javascript Navigation Question



kidtoxic
05-16-2007, 04:43 PM
I am trying to make simple links stay highlighted when clicked on until another link is selected. The 4 columns below the image area is the links/navigation I am referring to.

Also, at the bottom right hand corner of the image you will see Next and Previous links and I need these to scroll through the links that correspond to each image.

I am not sure why this is posing to be so difficult but I have posted this same question to 5 different forums out there and no-one seems to know how. The URL is:
http://manhattanwest.com/media-center/video-images.php

Is there anyone here that can help?

Thanks a ton!!

Spiritvn
05-17-2007, 04:13 AM
Hi i'm not a coder so i don't really know wat u mean for some phrases, but this:


simple links stay highlighted when clicked ...

i also think it's simple which you use:


a:active {
color: #ff0000;
}

or set the background and sth etc. if you want. The :active value means on clicked. If the link is linked to other page, i think it will not works (becoz it's reloaded) but if you use it on a ajax box, it will work i think.

Hope you can use it.
Hf

mwinter
05-17-2007, 05:46 PM
The :active value means on clicked.

To be precise (and a little redundant), the :active pseudo-class means "whilst active". The definition of active isn't defined in definite terms, but it's generally taking to mean whilst holding a button. So with a mouse, for instance, a link will be active in the time between the button press and the button release, but at no other moment.

riptide
05-17-2007, 05:55 PM
I'm confused thia sounds like javascript is needed or something

blm126
05-18-2007, 02:11 AM
I'm going to use jquery for this because I absolutely love it...Also, please upload jquery to your own site if you use this.


<script type="text/javascript" src="http://code.jquery.com/jquery-latest.pack.js"></script>
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery('#vidLinks a,#vidLinks2 a,#vidlinks3 a,#vidLinks4 a').bind('click',function(){
jQuery('a.currently').removeClass('currently');
jQuery(this).addClass('currently');
})
}
);
</script>
<style type="text/css">
a.currently{
background-color: gray;
}
</style>

Oh, and I didn't test this.