close

使用jquery scroll的目的主要是不想使用錨點, 所以就自己來寫一段程式碼吧~

點擊一物件後, scroll到指定物件上

$(selected_A).click(function(){
    $('html, body').animate({
        scrollTop: $(selected_B).offset().top
    }, 500);
}) ;

selected_Aselected_B 在自行替換

arrow
arrow
    文章標籤
    jquery scroll
    全站熱搜

    deathfullove 發表在 痞客邦 留言(0) 人氣()