1

如果有人在 chrome 中使用过 jsTree 并遇到类似问题,请告诉我。它不会在 IE 中中断(一切都是第一次),也不会在 FF 中中断。基本上,当我将鼠标悬停在图标上时,它会发生变化,但没有任何规律性,有时我将鼠标移出并保持不变(不正确),而当我再次将鼠标悬停在它上时,它会正确更改。我正在使用精灵图,我的类型定义如下所示:

$(...).tree({
    types : {
        'default': { icon: { image: spritePath} },
        'Type1': { icon: { position: '-42px -153px'} },
        'Type2': { icon: { position: '-28px -153px'} },
        'Type3': { icon: { position: '0px -153px'} },
        'Type4': { icon: { position: '-14px -153px'} }
    }
});
4

1 回答 1

0

我偶然发现了解决方案。给元素一个 ID 似乎可以解决问题。我使用 JSON 作为数据源,这可以解决问题。

{ "attr" : { "id" : "someId", "rel" : "noChildren" },
  "children" : [  ],
  "data" : "someName"
}
于 2010-07-27T14:59:23.307 回答