Created
December 19, 2012 07:33
-
-
Save Homlean/4335074 to your computer and use it in GitHub Desktop.
延迟resize
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
// 绑定 resize 重新定位事件 | |
var timeout; | |
Overlay.allOverlays = []; | |
$(window).resize(function() { | |
timeout && clearTimeout(timeout); | |
timeout = setTimeout(function() { | |
$(Overlay.allOverlays).each(function(i, item) { | |
// 当元素隐藏时,不处理 | |
if(!item.get('visible')) { | |
return; | |
} | |
item._setPosition(); | |
}); | |
}, 80); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment