在 IE8 中使用 jQuery JSTree 滚动时单击处理程序不再起作用
我正在使用 JStree 创建一个基本树。在每个浏览器中,它都会打开、关闭……除了 IE8 之外都很好。我将问题缩小到这一点:
当我不滚动页面并且树位于页面顶部时,所有点击都可以正常工作。
当我滚动页面(例如 20px)然后尝试打开树时,这不起作用。奇怪的是,如果我单击箭头上方 20px 来打开树,这就会起作用。我需要在实际箭头上方单击的像素数量取决于我在页面上滚动的程度。
我想这与某些元素的定位有关,但我无法弄清楚。有谁有任何经验或者 JSTree 或 IE8 中是否存在已知的错误?
非常感谢
I'm using JStree to create a basic tree. In every browser this opens, closes,... fine except in IE8. I narrowed the problem down to this:
When I don't scroll the page and the tree is positioned at the top of the page all clicks work fine.
When I have scrolled the page (eg 20px) and then try to open the tree this doesn't work. The weird thing is that if I click 20px above the arrow to open the tree this works. The amount of pixels I need to click above the actual arrow depends on how much I've scrolled on the page.
I guess this has something to do with the positioning of some elements but I can't figure it out. Does anyone have any experience or is there a known bug in JSTree or IE8 for this?
Many thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
问题(也可能是答案):您使用的是最新版本吗? JSTree 在 v1.0rc 中经历了完全重写。
Question (and might also be the answer): are you using the latest version? JSTree suffered a complete rewrite in v1.0rc.
嘿 PhysX,我遇到了同样的问题,必须解决它。我找不到任何有效的 jsTree 版本,但我确实发现,如果我将 IE8 设置为使用“兼容性视图”模式,问题就消失了。我的下一个想法是“如何强制用户的浏览器使用这种模式?”我研究了兼容性视图此处,并且发现我可以通过插入此元标记来解决问题:
这不是一个理想的解决方案,因为您网站的其余部分可能不想要这种模式,但它对我有用。
Hey PhysX, I ran into this same problem and had to fix it. I couldn't find any versions of jsTree that worked, but I did find that if I set IE8 to use "Compatability View" mode, the problem went away. My next thought was "How can I force the user's browser to use this mode?" I researched compatability view here, and found that I could fix the problem just by inserting this meta tag:
This isn't an ideal solution because the rest of your website may not want this mode, but it worked for me.