【发布时间】:2014-10-29 06:23:58
【问题描述】:
我在 asp.net MVC3 中有以下视图页面,
@using (Html.BeginForm())
{
<p>
test test
test test
test test
test test
test test
</p>
<article border="0" >
<iframe src ="@Url.Content("~/Content/test.html")" width="100%" height="300px" id="iframeContent"></iframe>
</article>
<p>
test test
test test
test test
test test
test test
</p>
<table>
<tr>
<td>
sample data
</td>
</tr>
</table>
}
iframe src html 文件有点大,所以它有滚动。我想检查html文件滚动是否到达底部。如果它到达底部,我需要做一些验证。
我可以通过使用下面的 jquery 来完成整个页面,但我不知道如何只为 iframe 滚动内容完成。大家有什么建议吗?
$(window).scroll(function() {
if($(window).scrollTop() + $(window).height() == $(document).height()) {
alert("Bottom Reached!");
}
});
【问题讨论】:
标签: javascript jquery html css iframe