jQuery Cycle Plugin Question
- Started
- Last post
- 13 Responses
- dbloc
I am attempting to highlight the nav buttons.
Can anyone help? Thanks!
- dbloc0
I've googed and and can't seem to find the solution.
- dbloc0
not sure what to add and where...
- dbloc0
needs to switch current <li> to .activeLI
- Boz0
hold on.. could you try explaining again?
you have buttons with one class style and then you want to toggle the style? or you want to change the style on all of them or what?
- dbloc0
only one li has the class .activeLI at all times depending on which is current
- dbloc0
or it could switch from .bluBG for current and all other have the class .goldBG
- dbloc0
not sure what the best way to go about it would be
- Boz0
look into toggleClass
- Boz0
does it highlight on rollover or click?
- Boz0
here's what I do..
I have nav items that are specific class.. like:
$('myNavClass').click(function...
this will assign the click to all elements of nav..
When you click on it.. you use $(this).toggleClass('myNavClass...
This will effectively highlight the one element you clicked on..
before you assign toggleClass.. you want to reset all nav items back to their default class.. so you make a function resetNav() and you take all nav elements and reset to their default class THEN you assign the toggleClass thing only on the $(this) element..
Makes sense?
- dbloc0
hmm. I'll try to work with that...I'm a javascript newbie
- dbloc0
Thanks for helping out boz
- Boz0
you can also use Jquery's class manipulation things like:
hasClass() to determine if your class is definied for a specific element..
you can also use $('element').css('cssproperty', 'value');
or you can simply just removeClass() and then addClass()
- .css() will allow you to directly change the css properties without changing the actual class.Boz