Jquery 每个循环都不工作
尝试循环浏览一些推荐,但没有循环,只会转到评论的结尾并停止。已尝试将each()放置在不同的位置,但它仍然不会循环。昨晚大部分时间都在想办法解决这个问题,但似乎没办法解决 我目前的代码是:Jquery 每个循环都不工作,jquery,loops,each,Jquery,Loops,Each,尝试循环浏览一些推荐,但没有循环,只会转到评论的结尾并停止。已尝试将each()放置在不同的位置,但它仍然不会循环。昨晚大部分时间都在想办法解决这个问题,但似乎没办法解决 我目前的代码是: $('.home-customer-comments').children('.customer-comment').each(function() { // Set first div to show $('.customer-comment:first').show(); //
$('.home-customer-comments').children('.customer-comment').each(function() {
// Set first div to show
$('.customer-comment:first').show();
// Begin the loop, fade out, find next div, fade that div in, end the process and append back to main div.
$('.customer-comment').each(setInterval(function() {
$('.customer-comment:first').fadeOut().hide().next('.customer-comment').fadeIn().end().appendTo('.customer-comment');
}, 1000))
});
我想你要找的是
jQuery(function () {
$('.customer-comment:first').show();
setInterval(function () {
$('.customer-comment:first').fadeOut().hide().next('.customer-comment').fadeIn().end().appendTo('.home-customer-comments');
}, 1000);
});
演示:我想你要找的是
jQuery(function () {
$('.customer-comment:first').show();
setInterval(function () {
$('.customer-comment:first').fadeOut().hide().next('.customer-comment').fadeIn().end().appendTo('.home-customer-comments');
}, 1000);
});
演示:我想你要找的是
jQuery(function () {
$('.customer-comment:first').show();
setInterval(function () {
$('.customer-comment:first').fadeOut().hide().next('.customer-comment').fadeIn().end().appendTo('.home-customer-comments');
}, 1000);
});
演示:我想你要找的是
jQuery(function () {
$('.customer-comment:first').show();
setInterval(function () {
$('.customer-comment:first').fadeOut().hide().next('.customer-comment').fadeIn().end().appendTo('.home-customer-comments');
}, 1000);
});
演示:你能发布你的HTML吗?将
setInterval()
(一个数字)的结果传递给。每个()
(需要一个函数)都没有意义。也许你还想使用$('.home customer comments')。查找而不是$('.home customer comments')。孩子?或者“客户评论”是“家庭客户评论”的直接子项吗?您可以发布您的HTML吗?将setInterval()
(一个数字)的结果传递给。每个()
(需要一个函数)都没有意义。也许您还想使用$('.home customer comments')。查找而不是$('.home customer comments')。children?或者“客户评论”是“家庭客户评论”的直接子项吗?您可以发布您的HTML吗?将setInterval()
(一个数字)的结果传递给。每个()
(需要一个函数)都没有意义。也许您还想使用$('.home customer comments')。查找而不是$('.home customer comments')。children?或者“客户评论”是“家庭客户评论”的直接子项吗?您可以发布您的HTML吗?将setInterval()
(一个数字)的结果传递给。每个()
(需要一个函数)都没有意义。也许您还想使用$('.home customer comments')。查找而不是$('.home customer comments')。children?还是“客户意见”是“家庭客户意见”的直接子项?谢谢!将它标记为答案时,它让我:-)谢谢这工作!将它标记为答案时,它让我:-)谢谢这工作!将它标记为答案时,它让我:-)谢谢这工作!当它允许我时,会将其标记为答案:-)