Created
December 19, 2013 08:15
-
-
Save zmmbreeze/8035994 to your computer and use it in GitHub Desktop.
Is element in client view. use tangram
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
var inView = function (e) { | |
var clientW = baidu.page.getViewWith(); | |
var clientH = baidu.page.getViewHeight(); | |
var rect = e.getBoundingClientRect(); | |
return (rect.bottom > 0 && rect.top < clientH) | |
&& (rect.right > 0 && rect.left < clientW); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment