【问题标题】:jstree - ie9 briefly expands and then collapses the tree on page refreshjstree - ie9 在页面刷新时短暂展开然后折叠树
【发布时间】:2012-07-01 19:18:24
【问题描述】:

我正在从 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'));
    });     

});

【问题讨论】:

    标签: firefox google-chrome internet-explorer-9 jstree


    【解决方案1】:

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

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

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

    $("#myJsTree").jstree({
        // set tree parameters here ...
    }).show();
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-10-06
      • 2019-11-14
      • 2013-07-05
      • 2013-09-22
      • 2018-01-25
      相关资源
      最近更新 更多