//捲到底次數(像分頁一樣) var sindex; $(function () { //begin get data from 1. sindex = 1; showDetial(sindex); $(window).scroll(function () { var $BodyHeight = $(document).height(); var $ViewportHeight = $(window).height(); $ScrollTop = $(this).scrollTop(); if ($BodyHeight == ($ViewportHeight + $ScrollTop)) { //scroll bar then add search index. sindex++; //get data. showDetial(sindex); } }); //avoid click F5 when scrollerbar not in bottom then default run scroll that have same data, so this check user if click buttom that scroll to top. $(window).keydown(function (e) { ...