Skip to content

Instantly share code, notes, and snippets.

@dstyle0210
Created December 26, 2018 04:28
Show Gist options
  • Select an option

  • Save dstyle0210/354f31aba3a3710a51dc3abbb2eaffe5 to your computer and use it in GitHub Desktop.

Select an option

Save dstyle0210/354f31aba3a3710a51dc3abbb2eaffe5 to your computer and use it in GitHub Desktop.
jquery에 scrollEnd 이벤트 삽입하기.
/**
$(body).on("scrollEnd",function(){
// 스크롤이 끝날때 1번만 실행.
});
*/
var _jqExtend = {};
_jqExtend.scrollEndTimeout = null;
_jqExtend.scrollEnd = {
delegateType:"scroll",
bindType:"scroll",
handle:function(event){
var me = this;
var handleObj = event.handleObj;
var arg = arguments;
clearTimeout(_jqExtend.scrollEndTimeout);
_jqExtend.scrollEndTimeout = setTimeout(function(){
handleObj.handler.apply( me, arg );
},50);
}
};
jQuery.event.special.scrollEnd = _jqExtend.scrollEnd;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment