Ajax 加载 Div 的页面不显示滚动条
我有一个页面,其中有几个 DIV,内容通过 ajax 加载。内容加载后,页面没有显示滚动条来显示所有DIV内容(我无法向下滚动查看其余内容。)我尝试使用Firefox和IE。所有人都有同样的问题。我可以解决这个问题吗?
I have a page with a couple DIVs with contents loaded via ajax. After the contents loaded, the page doesn't dislay the scrollbar to show all the DIV contents (I can't scroll down to see the rest of the content.) I tried with Firefox and IE. All have the same problem. Is there away I can fix this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您是否尝试在Div或class上设置样式?
Did you try to set style on the div or class?
在没有看到 HTML 和 CSS 的情况下,我只能提供一些建议:
您可以使用 TAB 滚动 div 或通过鼠标选择其内容吗?也许内容甚至没有完全加载。
Without seeing the HTML and CSS, all I can offer is a few suggestions:
Can you scroll around the div with TAB or by mouse-selecting its contents? Maybe the content isn't even being loaded fully.
在 CSS 中,我将 div 的位置固定
更改为
一切都很好。
In CSS I had the position of the div as fixed
changed it to
And all was good.
这已经很老了,但为了以防万一其他人到达这里,就像我一样,您必须重新绘制页面,因为添加滚动的计算已经完成。因此,您必须告诉浏览器在内容大小发生变化时重新绘制。您可以通过更改窗口的大小来测试是否是这种情况,如果这样做会恢复滚动条,然后在生成 DIV 或您生成的任何内容后重新绘制。
This is quite old, but just in case some else gets here, as me, you have to redraw the page, as the calculations to add a scroll has been already made. So you have to tell the browser to redraw as the content size has changed. You can test if this is the case by changing the size of the window, if doing so gets back the scroll bar, then redraw after generating the DIV or whatever you are generating.