[英]how to bind event on all elements except first 1 in jquery
I want to bind hover
event on all .menu class
element except first element
for this i wrote the following code : 我想在所有
.menu class
元素上绑定hover
事件,除了first element
,我写了下面的代码:
$(".menu:not(:first-child')").hover(function () {
},
function () {
});
But this is not working. 但这不起作用。 Whats the problem ?
有什么问题 ?
$(".menu").not(":first-child")
要么
$(".menu").not(":eq(0)")
使用此代码:
$('.menu').not(":first")
$(".menu:not(:first)").hover(function() {
},
function () {
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.