我的布局在 IE7 中中断并且 javascript 页面重新加载使屏幕闪烁
如果我更改 IE7/AOL 中的窗口大小,我的布局就会中断,因此我添加了一个在 window.onresize 上触发的简单 JavaScript 函数,但无论我如何更改位置,我都会遇到问题。
有人建议我发布一个链接,这里是: http://sinaesthesia.co.uk/
我已经使用 PHP 来检测浏览器并包含仅 IE7 的内联样式表(以及移动浏览器),并且我的页面看起来与 FF、Opera、Chrome、Safari 和 IE8 中的方式几乎相同,但是当我更改窗口大小时,有些事情会变得不稳定,如果你刷新一下就会恢复正常。欢迎任何建议:)
My layout breaks if I change the window size in IE7/AOL, so I added a simple javascript function that fires on window.onresize, but no matter how I change the location I get problems.
It was suggested I post a link and here it is: http://sinaesthesia.co.uk/
I already use PHP to detect browser and include an IE7-only inline stylesheet (and for mobile browsers), and my page looks nearly identical to the way it does in FF, Opera, Chrome, Safari and IE8, but when I change the window size, some things go wonky, and come back into line if you refresh. Any advice is welcome :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我建议您解决真正的问题:调整浏览器大小时布局会中断。在调整大小时重新加载页面绝对不是最佳实践。
如果您发布指向您页面的链接,您可能会深入了解问题的根源。
I advise you to fix the real problem: your layout breaking when the browser is resized. Reloading the page onresize is definitely not a best-practice.
If you post a link to your page, you might get some good insight into the sources of your problems.
我认为用 javascript 解决像你这样的布局问题不是一个好主意。
更好的方法是检测损坏的地方。并添加条件注释以包含仅 IE 样式表。
I think that fixing layout issues like yours with javascript is not a good idea.
A better approach would be to detect what is broken. and add a conditional comment to include an IE only stylesheet.
您应该解决布局问题。
无法按照您想要的方式刷新页面。重新加载时,所有内容都将重新绘制,并且闪烁/不闪烁取决于用户浏览器的确切状态。
You should fix the layout problems instead.
There is no way to refresh a page in the way you want to do it. On reload, everything will be redrawn, and the blinking/not blinking is dependent on the exact state of the users' browser.