是什么导致 Javascript 在严格模式下的 IE 中停止工作
我正在尝试调试我的 jQuery 插件,它在 IE 中运行良好,直到我添加 。它在除 IE 之外的所有浏览器中仍然可以正常工作sigh(在 6、7、8 中测试)。什么样的事情可能导致这种情况?
I'm trying to debug my jQuery plugin and it worked fine in IE until I added <!doctype html>
. It still works fine in all browsers except IE sigh (tested in 6,7,8). What sort of thing could be causing this?
here is the page: http://liime.net/projects/liimeBar/demo.html
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你在constructScrollers()中的条件
window.innerHeight <; $('body')[0].scrollHeight
为 false,因为在 IE8 中这两个值是相同的。
所以没有创建滚动条
在 jQuery 中做一些研究,你会找到正确的函数如何获得你想要测试的高度。
其中有很多代码,如果您使用更多 jQuery 函数而不仅仅是选择器,效果可能会更好。
- 编辑
试试这个
$(窗口).height() < $('body').height()
PS:通过这个脚本,你只能为正文制作一个滚动条,因为你对正文进行了硬编码。尝试 $(this) 相反,这是您调用 liimebar() 函数的对象,并且不要在 liimebar_buttons、..bar 等上使用 id,而是在类上使用,因此您可能拥有比滚动条更多的内容。
Your condition in constructScrollers()
window.innerHeight < $('body')[0].scrollHeight
is false, bacause both values are the same in IE8.
So no scrollers are created
Do some research in jQuery that you find the proper function how to get the heights you want to test.
You have much code in it, that could be better if you used more jQuery functions, not just the selectors.
--edit
try this instead
$(window).height() < $('body').height()
P.S.: By this script you can only make a scrollbar for the body, because you hard coded the body. try $(this) instead, which is the object you called your liimebar() function with and don't use ids on liimebar_buttons, ..bar etc, but classes, so you could possibly have more than on scrollbar.