我只是想知道我如何在nextAll
jquery的函数中有一个回调函数。
我试过了
$('.selector').nextAll(function() {
console.log("try");
});
但它不起作用。我阅读了jquery
网站上的文档,但是我注意到没有回调的示例。
我需要nextAll
而不是.each
遍历选择器的所有下一个后续元素,并让每个后续元素的边距正确,然后将它们向右设置动画。我试过了,
$('.selector').nextAll().animate({ right: (margin_right-100)+'px'}, 500);
//I am getting the logic here because it animates all the succeeding
//element but the problem is that I had to replace the
//`margin_right` variable because the elements next to the
//selector differs on margin-right.
有输入的人吗?
你们都尝试过吗?
$('.selector').nextAll().each(function() {
console.log(this);
});
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句