开发者

jstree: constraint width

开发者 https://www.devze.com 2023-01-09 18:37 出处:网络
I have a jstree with several subtrees on a page and would like to display something upon selection of a branch. The displayed text should appear next to the tree, but for some reason, jstree is taking

I have a jstree with several subtrees on a page and would like to display something upon selection of a branch. The displayed text should appear next to the tree, but for some reason, jstree is taking up all the space in the div, so the text div is placed underneath. The tree and div should both positioned relative to the encapsulating div and float left.

Is there any way to constrict the tree's wid开发者_如何学JAVAth (setting style="width=100px" on the tree div doesn't work)? Or another way to place the text right next to the tree without having it to place absolute?


You have to create a DIV that wraps your jstree-DIV, something like that:

<div id="wrap">
  <div id="jstree">
    // Here you have your tree 
  </div>
</div>

Now set wrapper CSS overflow property to auto and set maximum size:

#wrap {
    width: 200px;
    height: 400px;
    overflow: auto;
}


use max-width. E.g. max-width:100px; set maximum width to 100px.


Well, it seems that I have to live with this problem and change my layout.

0

精彩评论

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