IE浏览器中的jsTree显示缺陷 [英] jsTree display flaw in IE8

查看:167
本文介绍了IE浏览器中的jsTree显示缺陷的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用jsTree并在IE8中遇到问题。所有数据都在树中正确显示,但是当我尝试折叠树的一个分支时,它无法正确显示。也就是说,平滑崩溃动画会发生,但是当数据不应该再次显示时,数据会再次显示。

I've been working with jsTree and encountered a problem in IE8. All the data is displayed correctly in the tree, but when I attempt to collapse a branch of the tree it does not display properly. That is, the smooth collapse animation happens, but then the data is again visible when it should not be.

相同的代码在Firefox 3.6.27和Chrome 18.0上运行良好.1025.151。知道为什么IE8会有不同的行为吗?

The same code works great on Firefox 3.6.27 and Chrome 18.0.1025.151. Any idea why IE8 would behave differently?

这是网页的代码:

<html>
<head>
    <script type="text/javascript" src="jquery.js"></script>
    <script type="text/javascript" src="jstree/jquery.jstree.js"></script>
</head>
<body style="margin:0px">
    <script type="text/javascript">
        $(function() {
            $("#equipment_tree")
                .jstree({ "plugins" : ["themes","html_data","ui"] });
        });
    </script>
    <div id="equipment_tree" style="width:185px; float:left; height:100%; overflow:auto;">
        <ul>
            <li class="jstree-open"><a href="#">Root node 1</a>
                <ul>
                    <li><a href="#">Child node 1</a></li>
                    <li><a href="#">Child node 2</a></li>
                    <li><a href="#">Child node 3</a></li>
                    <li><a href="#">Child node 4</a></li>
                </ul></li>
            <li><a href="#">Root node 2</a></li>
        </ul>
    </div>
</body>
</html>

还有错误行为的图片:

And also a picture of the erroneous behavior:

推荐答案

您缺少!DOCTYPE 声明。将以下内容添加到页面顶部,这应解决问题...

You are missing the !DOCTYPE declaration. Add the following to the top of your page and that should fix the problem...

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

阅读其他关于!DOCTYPE for IE。

Read here about !DOCTYPE for IE.

这篇关于IE浏览器中的jsTree显示缺陷的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆