简体   繁体   English

jsTree 在 IE8 中的显示缺陷

[英]jsTree display flaw in IE8

I've been working with jsTree and encountered a problem in IE8.我一直在使用 jsTree 并在 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.也就是说,平滑崩溃 animation 发生了,但随后数据在不应该显示的情况下再次显示。

The same code works great on Firefox 3.6.27 and Chrome 18.0.1025.151.相同的代码在 Firefox 3.6.27 和 Chrome 18.0.1025.151 上运行良好。 Any idea why IE8 would behave differently?知道为什么 IE8 会有不同的行为吗?

Here is the code for the webpage:这是网页的代码:

<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:还有错误行为的图片:IE8 中 jsTree 的错误行为

You are missing the !DOCTYPE declaration.您缺少!DOCTYPE声明。 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">

Read here about.DOCTYPE for IE. 在这里阅读 about.DOCTYPE for IE。

This is perfect.太棒了。

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

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

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