2015-09-05 43 views
0

时如何让警报时scrollto mCoustomscroll或运行功能得到回调如何scrollto mCoustomscroll或运行功能

$('.section-wrap').mCustomScrollbar("scrollTo", 0, { 
    scrollInertia: 1500, 
    scrollEasing: "easeOut", 
    callback:{ 
     alert() or somefunc(); 
    }  
}); 

function somefunc(){ 
    alert(); 
} 

回答

0
jQuery('.section-wrap').mCustomScrollbar("scrollTo", 0, { 
    scrollInertia: 1500, 
    scrollEasing: "easeOut", 
    callbacks: { 
     onScroll: function(){ 
      // your code 
      alert('content scrolled...'); 
     } 
    } 
});