jQuery go to top 按鈕 (go to top button)

<html>
<div id="top">TOP</div>

<css>
#top{
position: fixed;
right: 50px;
bottom: 20px;
}

<script>
$(‘#top’).click(function () {
$(‘html,body’).animate({
‘scrollTop’ : ‘0px’
}, 1000);
});

Leave a Reply