Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How html5 uses the amazeui tree node to automatically expand the panel and select the first tree node

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article is about how html5 uses the amazeui tree node to automatically expand the panel and select the first tree node. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Amaze UI Tree is an extension of the Amaze framework, the advantage is that the style is consistent with the Amaze framework, the disadvantage is very imperfect, in order to be able to be applied in the project, its core code has been modified (another article published, will not repeat here). The function of the selected tree node in its API fails many times, so it simply rewrites one. As follows:

/ / expand the folding panel $("# user-nav"). Collapse ('open') by default; / / click the first button var btnArray = $(".am-tree-branch-name.click-item") by default; btnArray.each (function (I) {/ / console.log ($(this) .html () If (I = = 1) {$(this) .click (function () {$(".click-item") .removeClass ("am-tree-icon"); $(".click-item") .removeClass ("am-icon-check") $(this) .addClass ("am-tree-icon"); $(this) .addClass ("am-icon-check"); var obj = new Object () Obj.title = $(this) .attr ("data.title"); obj.level = $(this) .attr ("data.level") $(this) .trigger ('tree-click', {data: obj});}); $(this) .trigger (' click') Thank you for reading! On "html5 how to use the amazeui tree node to automatically expand the panel and select the first tree node" this article is shared here, I hope the above content can be of some help to you, so that you can learn more knowledge, if you think the article is good, you can share it out for more people to see it!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report