[英]going to first div after scroll going to top of the last div
我在滚动时遇到问题。 单击<a href="#" id="display" class="display">next</a>
标签时,页面滚动到下一个div
。 滚动到最后一个div
顶部,然后单击“下一个”时,它必须转到第一个div
的顶部,但不是。
修改您的代码:
if (t === 'next' ) {
if($('.current').next('.section').length==0)
var $next = $('#one');
else
var $next = $('.current').next('.section');
}
if (t === 'next') {
var $next = $('.current').next('.section');
//so no more next
if (!$next.length)
$next = $('div.section').first();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.