| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- var api;
- var e;
- var trig = true; //等于true时,可触发事件
- function scrll(){
- var height =document.documentElement.clientHeight;
- $("#jp-container").css("height",height-40);
- var pane = $('.jp-container');
- pane.jScrollPane({
- showArrows: true,
- });
- api = pane.data('jsp');
- pane.bind('jsp-scroll-y',function(event, scrollPositionY, isAtTop, isAtBottom){
- if(isAtBottom && trig){
- trig = false;
- loadnext(); //动态加载内容
- }
- });
- };
- function scrllTask(){
- var height =document.documentElement.clientHeight;
- $("#jp-container").css("height",height-100);
- var pane = $('.jp-container');
- pane.jScrollPane({
- showArrows: true,
- });
- api = pane.data('jsp');
- pane.bind('jsp-scroll-y',function(event, scrollPositionY, isAtTop, isAtBottom){
- if(isAtBottom && trig){
- trig = false;
- loadnext(); //动态加载内容
- }
- });
- };
- function loadnext(){
- api.reinitialise(); //滚动区域改变,刷新滚动条
- setTimeout(function(){trig=true;},500); //设置1秒后,滚动到底事件才可出发,防止连续出发导致浏览器死机
- }
|