cb8809365b276ddfa1664add63aa0024d887aec0
[framework/web/web-ui-fw.git] / libs / js / jquery-mobile-1.1.0 / docs / content / content-collapsible-events.html
1 <!DOCTYPE html> 
2 <html>
3         <head>
4         <meta charset="utf-8">
5         <meta name="viewport" content="width=device-width, initial-scale=1"> 
6         <title>jQuery Mobile Docs - Collapsible Content</title> 
7         <link rel="stylesheet"  href="../../css/themes/default/jquery.mobile.css" />  
8         <link rel="stylesheet" href="../_assets/css/jqm-docs.css"/>
9
10         <script src="../../js/jquery.js"></script>
11         <script src="../../docs/_assets/js/jqm-docs.js"></script>
12         <script src="../../js/"></script>
13
14 </head> 
15 <body> 
16
17         <div data-role="page" class="type-interior">
18
19                 <div data-role="header" data-theme="f">
20                         <h1>Collapsible</h1>
21                         <a href="../../" data-icon="home" data-iconpos="notext" data-direction="reverse">Home</a>
22                         <a href="../nav.html" data-icon="search" data-iconpos="notext" data-rel="dialog" data-transition="fade">Search</a>
23                 </div><!-- /header -->
24
25         <div data-role="content">
26                 <div class="content-primary">
27                 <h2>Collapsible content</h2>
28                 
29                         <ul data-role="controlgroup" data-type="horizontal" class="localnav">
30                                 <li><a href="content-collapsible.html" data-role="button" data-transition="fade">Basics</a></li>
31                                 <li><a href="content-collapsible-options.html" data-role="button" data-transition="fade">Options</a></li>
32                                 <li><a href="content-collapsible-methods.html" data-role="button" data-transition="fade">Methods</a></li>
33                                 <li><a href="content-collapsible-events.html" data-role="button" data-transition="fade" class="ui-btn-active">Events</a></li>
34                         </ul>
35
36                         <p>Bind events directly to the container, typically a <code>div</code> element.  Use jQuery Mobile's <a href="../api/events.html">virtual events</a>, or bind standard JavaScript events, like change, focus, blur, etc.:</p>
37                         <pre><code>
38 $( ".selector" ).bind( "collapse", function(event, ui) {
39   ...
40 });
41 </code></pre>
42
43                         <p>The collapsible plugin has the following custom events:</p>
44
45         <dl>
46
47                 <dt><code>create</code> triggered when a collapsible is created</dt>
48                 <dd>
49
50                         <pre><code>
51 $( ".selector" ).collapsible({
52    create: function(event, ui) { ... }
53 });
54                         </code></pre>
55                 </dd>
56
57                 <dt><code>collapse</code> triggered when a collapsible is collapsed</dt>
58                 <dd>
59
60                         <pre><code>
61 $( ".selector" ).collapsible({
62    collapse: function(event, ui) { ... }
63 });
64                         </code></pre>
65                 </dd>
66
67                 <dt><code>expand</code> triggered when a collapsible is expanded</dt>
68                 <dd>
69
70                         <pre><code>
71 $( ".selector" ).collapsible({
72    expand: function(event, ui) { ... }
73 });
74                         </code></pre>
75                 </dd>
76
77         </dl>
78
79         </div><!--/content-primary -->          
80         
81         <div class="content-secondary">
82                 
83                 <div data-role="collapsible" data-collapsed="true" data-theme="b" data-content-theme="d">
84                         
85                                 <h3>More in this section</h3>
86                                 
87                                 <ul data-role="listview" data-theme="c" data-dividertheme="d">
88                                 
89                                         <li data-role="list-divider">Content Formatting</li>
90                                         <li><a href="content-html.html">Basic HTML styles</a></li>
91                                         <li><a href="content-grids.html">Layout grids (columns)</a></li>
92                                         <li data-theme="a"><a href="content-collapsible.html">Collapsible content blocks</a></li>
93                                         <li><a href="content-collapsible-set.html">Collapsible sets (accordions)</a></li>
94                                         <li><a href="content-themes.html">Theming content</a></li>
95         
96                                 </ul>
97                 </div>
98         </div>
99
100 </div><!-- /content -->
101
102 <div data-role="footer" class="footer-docs" data-theme="c">
103                 <p>&copy; 2011-12 The jQuery Foundation</p>
104 </div>
105         
106 </div><!-- /page -->
107
108 </body>
109 </html>