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.
The same code works great on Firefox 3.6.27 and Chrome 18.0.1025.151. Any idea why IE8 would behave differently?
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:
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.
The same code works great on Firefox 3.6.27 and Chrome 18.0.1025.151. Any idea why IE8 would behave differently?
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:
Share Improve this question asked Apr 10, 2012 at 15:41 Dylan KlomparensDylan Klomparens 2,9727 gold badges38 silver badges54 bronze badges2 Answers
Reset to default 5You 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/TR/xhtml1/DTD/xhtml1-strict.dtd">
Read here about !DOCTYPE for IE.
This is perfect.
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3/TR/xhtml1/DTD/xhtml1-strict.dtd">
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744753994a4591769.html
评论列表(0条)