开发者

jsTree: icon changes on mouseover in chrome, it shouldn't

开发者 https://www.devze.com 2022-12-26 19:41 出处:网络
If anyone has used jsTree in chrome and had a similar issue please let me kn开发者_开发知识库ow. It doesn\'t break in IE (first time for everything) nor in FF.Basically, when I mouse over an icon it c

If anyone has used jsTree in chrome and had a similar issue please let me kn开发者_开发知识库ow. It doesn't break in IE (first time for everything) nor in FF. Basically, when I mouse over an icon it changes, but not with any regularity, some times I mouse out and stays the same (incorrect) and when I mouse over it again it changes correctly. I'm using a sprite map and my type definitions look like so:

$(...).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'} }
    }
});


I stumbled on the solution by coincidence. Giving the elements an Id seems to fix the problem. I'm using JSON as datasource and this does the trick.

{ "attr" : { "id" : "someId", "rel" : "noChildren" },
  "children" : [  ],
  "data" : "someName"
}
0

精彩评论

暂无评论...
验证码 换一张
取 消