JQuery not filter
function() {
$(this).animate({ width: 130 }, 300, function() { });
});
开发者_如何学Python
I wanna animate only those li's whose width is not 160
Thanks
$('li').filter(function() { return $(this).width() != 160 }).animate({ width: 130 }, 300, function() { });
For readability:
jQuery.expr[':'].width = function(e, ix, match) { return $(e).width() == match[3]; };
You may then, at any point, do:
$('li:not(:width(160))').animate({ width: 130 }, 300, function() { });
精彩评论