在iframe上滚动而无需滚动整个网页
我正在开发一个网站,该网站使用左侧的导航的布局,以及中间的内容iframe
。鉴于在内容iframe
中显示的某些页面的文本明显少于其他页面,因此我不想只为我的内容iframe 因为这将导致大多数页面不必要的大量空格。
理想情况下,我应该能够在离开网页的其余部分时滚动iframe
,我应该只能滚动,只能滚动到当前加载页面上的内容content iframe
(也许加上25个像素左右,只是为了一些不错的填充)。
当前,内容iframe
的代码如下:
< iframe name =“ content” src =“ content.html” style =“高度:2500px; width; width:1500px; border:border:无:绝对:215px; title =“ content pane”></iframe>
我想避免使用JavaScript。我现在大概进行了十二个不同的网站,但这似乎是一个简单的问题。
I'm in the process of developing a website which uses the layout of having the navigation iframe
on the left, and the content iframe
in the middle. Given that some of the pages which will display in the content iframe
have significantly less text than others, I don't want to just have some arbitrarily large height value for my content iframe
as that will result in unnecessarily large amounts of whitespace for most pages.
Ideally, I should be able to scroll on the content iframe
while leaving the rest of the webpage in place, and I should be able to scroll only as far as there is content on the currently loaded page in the content iframe
(maybe plus 25 pixels or so just for some nice padding).
Currently, the code for the content iframe
is as follows:
<iframe name="content" src="content.html" style="height:2500px; width:1500px; border:none; position:absolute; top:215px; left:205px; scrolling:yes; overflow-y:scroll;" title="Content Pane"></iframe>
I want to avoid JavaScript if at all possible. I've went on probably a dozen different websites now to no avail, but this seems like it should be a simple problem to solve.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论