开发者

different color for different levels of rows in jsTree

how can get different row color for different 'level' of rows in jsTree

let's say that in my sample http://jsfiddle.net/radek/sTmrv/2/

  • basics & all will have the same color
  • 开发者_Go百科
  • login, Basics of Edu, login, Add Academic year .... will have the same but different color
  • and finally the 3rd level will have the same color.

  • so far I managed to change color of all rows ....


Would this work for you? See http://jsfiddle.net/sTmrv/4/

You may have to play with it a bit (untested in IE).

li.jstree-open > ul {
    background: red;
    display: block;
}
li.jstree-open > ul li.jstree-open > ul {
    background: #CCC;
    position: relative;
    left: -18px;
    padding-left: 18px;
    width: 100%;
 }


You could do a loop with a generated row id, and base the colors on the multiple of the row Id.. let me try typing up something quickly.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜