1

我正在从 UL 加载树,在 Firefox 或 Chrome 中,页面刷新很好。但在 IE9 中,整个树在折叠回应有的状态之前会进行短暂(且丑陋)的扩展。这是十分之一秒或其他任何时间,但它是该项目的展示停止器。

任何有关如何防止这种行为的建议将不胜感激。文档类型 html 4.01。Jsquery 最小 1.7.2。杰树 1.0。代码如下。

$(function(){
$("#treeview").jstree({
    "themes" : {
        "theme" : "default",
        "dots" : false,
        "icons" : false
    },
    "ui" : {
            "selected_parent_close" : "false",
            "select_multiple_modifier" : "false",
            "initially_select" : [$('body').attr('id')],
    },
    "core": { 
                "animation": 500
            },
    "cookies" : {
                "save_selected" : false
                }, 
    "plugins" : [ "themes", "html_data", "ui", "cookies" ]

});
$("#treeview").bind("reselect.jstree", function () {
    $("#treeview").bind("select_node.jstree", function (e, data) {
        document.location = data.rslt.obj.children("a").attr("href");
    });
}); 
$("#treeview").bind("loaded.jstree", function () {
    $("#treeview").jstree("open_all", "#" + $('body').attr('id'));
    });     

});

4

1 回答 1

0

首先在你的 div 中使用 display: none 隐藏树

<div id="myJsTree" style="display: none">

</div>

在你的 jquery 中,一旦你将 jstree 应用到你的 div 之后,使树可见

$("#myJsTree").jstree({
    // set tree parameters here ...
}).show();
于 2016-04-12T13:43:26.237 回答