ff6b9bcc3630d9f694490d3e6e2c2eadc0807939
[platform/framework/web/web-ui-fw.git] / libs / js / jquery-mobile-1.0.1pre / docs / buttons / buttons-grouped.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 - Grouped Buttons</title> 
7         <link rel="stylesheet"  href="../../css/themes/default/" /> 
8         <link rel="stylesheet" href="../_assets/css/jqm-docs.css"/> 
9         <script src="../../js/jquery.js"></script>
10         <script src="../../experiments/themeswitcher/jquery.mobile.themeswitcher.js"></script>
11         <script src="../_assets/js/jqm-docs.js"></script>
12         <script src="../../js/"></script>
13 </head>
14 <body> 
15
16 <div data-role="page" class="type-interior">
17
18         <div data-role="header" data-theme="f">
19                 <h1>Grouped buttons</h1>
20                 <a href="../../" data-icon="home" data-iconpos="notext" data-direction="reverse" class="ui-btn-right jqm-home">Home</a>
21         </div><!-- /header -->
22
23         <div data-role="content">
24                 <div class="content-primary">
25                 
26                 <p>Occasionally, you may want to visually group a set of buttons together to form a single block that looks contained like a navigation component. To get this effect, wrap a set of buttons in a container with the <code> data-role="controlgroup"</code> attribute &mdash; the framework will create a vertical button group, remove all margins and drop shadows between the buttons, and only round the first and last buttons of the set to create the effect that they are grouped together. </p>
27 <pre><code>
28 &lt;div data-role=&quot;controlgroup&quot;&gt;
29 &lt;a href=&quot;index.html&quot; data-role=&quot;button&quot;&gt;Yes&lt;/a&gt;
30 &lt;a href=&quot;index.html&quot; data-role=&quot;button&quot;&gt;No&lt;/a&gt;
31 &lt;a href=&quot;index.html&quot; data-role=&quot;button&quot;&gt;Maybe&lt;/a&gt;
32 &lt;/div&gt;
33 </code></pre>
34
35                 <p>By default, grouped buttons are presented as a vertical list:</p>
36                 
37                 <div data-role="controlgroup">
38                         <a href="index.html" data-role="button">Yes</a>
39                         <a href="index.html" data-role="button">No</a>
40                         <a href="index.html" data-role="button">Maybe</a>
41                 </div>
42                 
43                 <p>By adding the <code>data-type="horizontal"</code> attribute to the <code>controlgroup</code> container, you can swap to a horizontal-style group that floats the buttons side-by-side and sets the width to only be large enough to fit the content. (Be aware that these will wrap to multiple lines if the number of buttons or the overall text length is too wide for the screen.)
44                 
45                 <p>Horizontal grouped buttons:</p>
46                 <div data-role="controlgroup" data-type="horizontal">
47                         <a href="index.html" data-role="button">Yes</a>
48                         <a href="index.html" data-role="button">No</a>
49                         <a href="index.html" data-role="button">Maybe</a>
50                 </div>
51                         
52                 <p>Horizontal grouped buttons with icons:</p>
53                 <div data-role="controlgroup" data-type="horizontal" >
54                         <a href="index.html" data-role="button" data-icon="plus">Add</a>
55                         <a href="index.html" data-role="button" data-icon="delete">Delete</a>
56                 </div>
57                 
58                 <p>Horizontal grouped buttons, icon only:</p>
59                 <div data-role="controlgroup" data-type="horizontal" >
60                         <a href="index.html" data-role="button" data-icon="arrow-u" data-iconpos="notext">Up</a>
61                         <a href="index.html" data-role="button" data-icon="arrow-d" data-iconpos="notext">Down</a>
62                         <a href="index.html" data-role="button" data-icon="delete" data-iconpos="notext">Delete</a>
63                 </div>
64                 
65                 
66         </div><!--/content-primary -->          
67         
68         <div class="content-secondary">
69                 
70                 <div data-role="collapsible" data-collapsed="true" data-theme="b" data-content-theme="d">
71                         
72                                 <h3>More in this section</h3>
73                                 
74                                 <ul data-role="listview" data-theme="c" data-dividertheme="d">
75                                 
76                                         <li data-role="list-divider">Buttons</li>
77                                         <li><a href="buttons-types.html">Button basics</a></li>
78                                         <li><a href="buttons-icons.html">Button icons</a></li>
79                                         <li><a href="buttons-inline.html">Inline buttons</a></li>
80                                         <li data-theme="a"><a href="buttons-grouped.html">Grouped buttons</a></li>
81                                         <li><a href="buttons-themes.html">Theming buttons</a></li>
82         
83                                 </ul>
84                 </div>
85         </div>          
86
87 </div><!-- /content -->
88
89 <div data-role="footer" class="footer-docs" data-theme="c">
90                 <p>&copy; 2011 The jQuery Project</p>
91 </div>
92         
93 </div><!-- /page -->
94
95 </body>
96 </html>