Created
December 26, 2018 04:28
-
-
Save dstyle0210/354f31aba3a3710a51dc3abbb2eaffe5 to your computer and use it in GitHub Desktop.
jquery에 scrollEnd 이벤트 삽입하기.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| $(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