如何讓此滾動到下一個課程?滾動到下一個類
var $root = $('html, body');
$('a.scroll-to-next-nav').click(function(){
$root.animate({
scrollTop: $($(this).closest('.header-icons').nextAll('.header-icons')).offset().top
}, 500);
return false;
});
<div class="header-icons"><a href="#" class="scroll-to-next-nav" title="Go to next section">Go to next section</a></div>
<div class="header-icons"><a href="#" class="scroll-to-next-nav" title="Go to next section">Go to next section</a></div>
<div class="header-icons"><a href="#" class="scroll-to-next-nav" title="Go to next section">Go to next section</a></div>
你忘了用點 – Musa
你是正確的前綴你的類選擇。但是,修復後它仍然不起作用? – simple