Reputation: 2805
I want to bind hover
event on all .menu class
element except first element
for this i wrote the following code :
$(".menu:not(:first-child')").hover(function () {
},
function () {
});
But this is not working. Whats the problem ?
Upvotes: 1
Views: 228
Reputation: 8280
jQuery's slice
method
$('.menu').slice(1).hover(function () {
// in
}, function () {
// out
});
Just to be different...
Upvotes: 1
Reputation: 374
$(".menu:not(:first)").hover(function() {
},
function () {
});
Upvotes: 0