1 2(function ($) { 3 $.fn.infiniteJscroll = function () { 4 5 var $win = this; 6 var options = $.extend({ 7 totalPage : 2, 8 numberPage : 1, 9 offset: 100, 10 topOfPage: function () { 11 }, 12 bottomOfPage: function () { 13 }, 14 pageInit: function () { 15 } 16 }, arguments[0] || {}); 17 18 $(document).ready(function () { 19 options.pageInit.call(this); 20 }); 21 22 $win.scroll(function () { 23 24 var scrollHeight = $(document).height() - 300; 25 var scrollPosition = $(window).height() + $(window).scrollTop(); 26 27 if ($win.scrollTop() == 0) { 28 options.topOfPage.call(this, options); 29 } 30 else if ($win.scrollTop() + options.offset >= $(document).height() - $(window).height() && options.totalPage != options.numberPage) { 31 if (scrollPosition >= scrollHeight) { 32 33 } 34 else { 35 options.bottomOfPage.call(this, options); 36 } 37 } 38 }); 39 }; 40}(jQuery));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.