jquery - how can I have hover style by default? -
i have list , each has css hover state. default every item black , hovering turns blue. my problem: want first item blue before hovering loading page. once user hovers other item first 1 not blue anymore , other normal items turns blue hovering.
here jsfiddle.
html:
<ul> <li>one</li> <li>two</li> <li>three</li> </ul>
css:
ul li:hover { color:blue; }
<ul> <li class="active">one</li> <li>two</li> <li>three</li> </ul> <style> ul li:hover, ui li.active { color:blue; } </style> <script> $('ul').hover(function(){ $('ul li').removeclass('active'); } , function(){}); </script>
Comments
Post a Comment