简体   繁体   English

IE显示错误,jQuery错误

[英]IE Display Bug, jQuery bug

So I built some complex ajaxy jquery module on my homepage, with the help of "scrollable" from flowplayer.org . 因此,在flowplayer.org的“ scrollable”帮助下,我在主页上构建了一些复杂的ajaxy jquery模块。

It works fine for me on Chrome, Opera, Firefox ... but of course IE is not playing friendly (regardless of the version, from my testing). 它对我在Chrome,Opera和Firefox上都可以正常工作,但是IE当然不是很友好(不管是哪个版本,根据我的测试)。

Objects are not displaying exactly where they should, some are overlaying each other, and when a click a button some divs just disappear. 对象未完全显示应有的位置,一些对象彼此重叠,单击按钮时某些div消失了。

However, if I resize the IE browser window up and down, the display mostly fixes itself. 但是,如果我上下调整IE浏览器窗口的大小,则显示内容大部分会自行修复。 Then if I click on one of the buttons I made, it messes it up again. 然后,如果我单击所创建的按钮之一,则会再次使其混乱。 Until I resize the window again and it looks fine. 直到我再次调整窗口大小,看起来还不错。

To see the problem: 要查看问题:

(note the forceshowIE=1, because by default I hide it for IE people) (请注意forceshowIE = 1,因为默认情况下我为IE用户隐藏了它)

I was thinking maybe there is a way to force IE to redraw the entire module sometimes? 我在想,也许有一种方法有时可以迫使IE重绘整个模块? Or maybe someone has a better idea on how to fix the underlying problem? 或者,也许有人对如何解决潜在问题有更好的主意?

Source code is available here: 源代码在这里可用:

http://www.makemeheal.com/mmh/scripts/recentHistory.js http://www.makemeheal.com/mmh/scripts/recentHistory.js

http://www.makemeheal.com/mmh/styles/recentHistory.css http://www.makemeheal.com/mmh/styles/recentHistory.css

Thanks 谢谢

You are missing a doctype declaration at the top of the file, this is causing IE to revert to quirks mode. 您在文件顶部缺少doctype声明,这导致IE恢复为怪癖模式。 Providing a doctype will cause IE to render in standards mode. 提供doctype将导致IE以标准模式呈现。 (cant say IE6 will still behave, but IE7/IE8 should be more consistent with the other browsers) (不能说IE6仍然会起作用,但IE7 / IE8应该与其他浏览器更加一致)

Try putting this at the top of the main file: 尝试将其放在主文件的顶部:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Hopefully that fixes it. 希望能解决它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM