Home > Web Front-end > JS Tutorial > body text

Easy UI clicks on the text to realize the expand and close function

小云云
Release: 2018-01-27 14:33:00
Original
1591 people have browsed it

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==&#39;closed&#39;&&(!$("#tree").tree(&#39;isLeaf&#39;,node.target))){ //状态为关闭而且非叶子节点 
           $(this).tree(&#39;expand&#39;,node.target);//点击文字展开菜单  
         }else{ 
           $(this).tree(&#39;collapse&#39;,node.target); 
         } 
      } 
       
    } 
  })
Copy after login

Related recommendations:

JS simple expand and close switching code_javascript skills

JS method to operate css attributes to achieve the expansion and closing effect of div layer _javascript skills

JQUERY method to implement fixed position expansion and closing effects in the lower right corner of the web page_jquery

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!