Home > Article > Web Front-end > Easy UI clicks on the text to realize the expand and close function
This article mainly introduces the Easy UI dynamic tree click text to realize the expansion and closing function. Friends who need it can refer to it. I hope it can help everyone.
Just click on the tree function at the JSP and add a piece of code:
The whole is as follows:
<span style="white-space:pre"> </span>$("#tt").tree({ onClick: function(node){ if(node.url != null){ parent.frames["content"].location.href="${ctx}" rel="external nofollow" + node.url; }else{ if(node.state=='closed'&&(!$("#tree").tree('isLeaf',node.target))){ //状态为关闭而且非叶子节点 $(this).tree('expand',node.target);//点击文字展开菜单 }else{ $(this).tree('collapse',node.target); } } } })
Related recommendations:
JS simple expand and close switching code_javascript skills
The above is the detailed content of Easy UI clicks on the text to realize the expand and close function. For more information, please follow other related articles on the PHP Chinese website!