我需要确定iframe中的元素是否在屏幕上可见。 (如果是在屏幕的可见部分) 我指的是页面可以很长,用户必须滚动才能看到的元素确定iframe中的元素是否在屏幕上可见
的index.html:
<html>
...
...
<iframe src="iframe.html" />
...
...
</html>
Iframe.html的:
<html>
...
...
<div id="element"></div>
....
...
<script type="text/javascript">
var el = document.getElementById('element');
if (isElementVisible(el)) {
// do something
}
</script>
</html>
如何编写这样的函数isElementVisible()?
这个问题的任何消息? – Sunyatasattva 2013-03-10 00:37:46