【问题标题】:Refreshing jstree without tree 'flashing' in chrome在 Chrome 中刷新没有树“闪烁”的 jstree
【发布时间】:2013-12-04 16:28:51
【问题描述】:

我有一个带有jstree 的页面。它以 JSON 格式从服务器加载树内容。

$("#" + this.treeComponentID).jstree({        
        plugins: ["themes", "json_data", "ui", "types"],
        themes: {
            theme: "classic"
        },
        json_data: {
            "ajax": {
                "url": this.dataLoadURL
            }
        },
        ui: {
            select_limit: 1
        }
    });

我每 20 多岁打一次电话

 $('#tree').jstree("refresh", -1);

刷新树,因为内容可能会在后端发生变化。这一切都很好,除了我在 Chrome 中获得了大约 200 毫秒的组件闪存。如果您在页面上查看并且每 20 秒闪烁一次,这将非常烦人。

所以我想知道是否有某种方法可以避免这种闪光。更奇怪的是IE8不闪。它只是安静而流畅地重新绘制树。

我正在使用 jsTree 1.0-rc3,它在演示中的 jstree 网页上提供。

任何帮助将不胜感激。

【问题讨论】:

  • 你解决过这个问题吗?

标签: javascript jquery jstree


【解决方案1】:

与其进行刷新,不如进行重绘?

$('#tree').jstree("redraw");

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-09-22
    • 2015-10-19
    • 2012-02-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多