0

我在 IFrame 中有网格视图。当记录适合框架时,它工作得很好。但是,如果我显示更多记录,则无法单击页脚行。当我尝试向下滚动时,它会自动上升。我在 AJAX 的更新面板中使用这个网格视图。为什么会这样?可能是什么解决方案。

提前致谢。

4

1 回答 1

1
  • 一种想法是在 iframe 中不需要 UpdatePanel。iframe 是由他自己加载的,您不需要添加额外的 ajax 来使想法复杂化。所以 ether 离开iframe并删除UpdatePanel, ether remove UpdatePanel保留 iframe 并在页面 loaf 之后调整大小。

  • 一秒钟的想法是查看 iframe 上是否有滚动条。

  • 三分之一作为您问题的解决方案,是在每次 reload/update 时重新计算 iframe 大小

如何重新计算大小

在 iframe 上使用onload并在 iframe 上重新计算/设置新的宽度和高度。

当 iframe 中加载了新内容时会触发 onload。

一些类似的:
动态调整导航 div 到主要内容
在一个页面上显示两个网页

在互联网上,您可以找到一些如何获得内部宽度的示例。这是一个...

http://www.infoqu.com/dev/javascript-development/getting-iframe-width-194102-1/

var the_height=document.getElementById('the_iframe').contentWindow.document.body.scrollHeight;//find the height of the internal page

var the_width=document.getElementById('the_iframe').contentWindow.document.body.scrollWidth;//find the width of the internal page
于 2011-04-18T14:03:31.043 回答