1: Folding panels can place content of different categories in different panels . These panels are stacked on the page, and users can expand them by clicking on the title of each panel. This panel, view the content of the panel, At the same time, other panels will be automatically folded and hidden $(selector).accordion(options); options can be selected The properties are: disabled, active, animated, autoHeight, clearStyle, collapsible, event, fillSpace, header, icons, navigation, navigationFilter Simple example:
Accordion AutoHeight</ title><br> <link rel="stylesheet" href="themes/base/jquery.ui.all.css"><br> <script src="JS/jquery-1.4.2.min.js "></script><br> <script src="JS/jquery.ui.core.js"></script><br> <script src="JS/jquery.ui.widget .js"></script><br> <script src="JS/jquery.ui.accordion.js"></script><br> <script><br> $(function( ) {<br> $( "#accordion" ).accordion({<br> autoHeight: false<br> });<br> }); <br> </script><br> <style type= "text/css"><br> #accordion h3{ font-size:13px; font-weight:700; }<br> #accordion>div{ font-size:12px; }<br> </style> <h3><a href="#">Title 1</a> ;</h3><br> <div><br> This is a small piece of content<br /><br> </div><br> <h3><a href=" #">Title 2</a></h3><br> <div><br> This is a very long piece of content<br />This is a very long piece of content<br /> ;<br> This is a very long content<br />This is a very long content<br /><br> This is a very long content<br />This is a very long content Long content<br /><br> This is a very long content<br />This is a very long content<br /><br> </div><br>< ;/div><br><div style="margin:8px 0; padding:10px; height:50px; border:solid 1px #aaa;"><br>This is another module that will work with the accordion panel <br></div><br></body><br></html><br><br><br>Rendering: <br><br>
</div> <br><br><img src="/static/imghw/default1.png" data-src="http://files.jb51.net/file_images/article/201306/2013061915524116.png" class="lazy" alt="">2: Customize accordion panel icon<br><br><strong><font style="max-width:90%"><br></font></strong>Copy code<div class="codetitle"><span><a style="CURSOR: pointer" data="18901" class="copybut" id="copybut18901" onclick="doCopy('code18901')"> The code is as follows :<u><div class="codebody" id="code18901">
<br><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><br><html xmlns="http://www.w3.org/1999/xhtml"><br><head><br><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><br> <title>Accordion Icon
The above code first initializes the folding panel as a component that can automatically fill the parent element, then sets the container to automatically resize, and calls it when the size of the container control changes. The resize method of the folding panel, finally achieves the effect of resizing together 5: Events of the folding panel change and changestart events
*event: triggered event object *ui: View object , has 4 attributes, namely newHeader, which represents the title of the current panel; oldHeader, which represents the title of the previous panel; newContent: which represents the content of the current panel; oldContent, which represents the content of the previous panel, These return jQuery objects
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