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

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -