[英]How can i collapse all parents for one branch?
I have tree in my shop. 我的商店里有树。 I need when i go trough some good i need open exactly that branch that contain my good.
我需要在进入某些商品时需要完全打开包含我的商品的分支。
<ul id="treeview" class="treeview-black">
<li>Item 1</li>
<li>
<span>Item 2</span>
<ul>
<li>
<span>Item 2.1</span>
<ul>
<li>Item 2.1.1</li>
<li>Item 2.1.2</li>
</ul>
</li>
<li>Item 2.2</li>
<li>
<span>Item 2.3 (closed at start)</span>
<ul>
<li>Item 2.3.1</li>
<li>Item 2.3.2</li>
</ul>
</li>
</ul>
</li>
</ul>
$("#treeview").treeview({
animated: "fast",
collapsed: true,
unique: true,
persist: "location"
});
I need open some branch when page will be open and do this with JavaScript code. 当页面将打开时,我需要打开一些分支,并使用JavaScript代码执行此操作。 Thanks in advance.
提前致谢。
Here is your solution 这是您的解决方案
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.