nextAll()中的回调函数

HTTP

我只是想知道我如何在nextAlljquery的函数中有一个回调函数

我试过了

$('.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.

有输入的人吗?

杰森p

你们都尝试过吗?

$('.selector').nextAll().each(function() { 
  console.log(this);
});

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章