jquery hasClass "active" on ul#navigation li on page load not working

Posted by Ross on Stack Overflow See other posts from Stack Overflow or by Ross
Published on 2009-10-27T19:04:18Z Indexed on 2010/04/17 12:33 UTC
Read the original article Hit count: 258

Filed under:
|
|
|
|
$(document).ready(function(){

$("li").click(function(){

    if ($(this).hasClass("active") )

          $(this).fadeTo("slow", 1.0); 

    });
});

I have a navigation bar made and am using this code to add a transparency effect on hover:

$(document).ready(function(){
 $(".thumbs").fadeTo("slow", 0.6); 

 $(".thumbs").hover(function(){

    $(this).fadeTo("slow", 1.0); 

    },function(){

    $(this).fadeTo("slow", 0.4); 

    });

});

I'm also using hoverIntent.

The opacity rollover works a treat, but I'd like my "active" page to have 100% opacity, but I can't seem to get it to work..what am I doing wrong?

the link in questions HTML is:

<ul id="navigation">
  <li class="active"><a href="page.htm"></a></li>
</ul>

the nav works perfect minus my "active" class so I think I provided all the necessary code. thank you.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about hoverintent