开发者

problem to specify function effect on one menu

开发者 https://www.devze.com 2023-01-31 23:57 出处:网络
Q:: I use a jquery function in jquery file (included in the master pa开发者_运维知识库ge):: $(\"li\").mouseover(function(){

Q:: I use a jquery function in jquery file (included in the master pa开发者_运维知识库ge)::

$("li").mouseover(function(){ $(this).stop().animate({height:'230px'},{queue:false, duration:10, easing: 'easeOutBounce'}) });

I have many list items in my web site but I wanna this function to be applied only on a set of list items(in one ul)exists in the master page and not for all my menus I have.

how to fix this problem..


Give the ul a class and use the descendent selector:

<ul class="bounce">
 <li>Text</li>
 etc...
</ul>

jQuery:

$('ul.bounce li').mouseover(function(){
    // your code here
});


Don't select all li's, just select the ones you want?

$("#ulid li")...
0

精彩评论

暂无评论...
验证码 换一张
取 消