Page 110 - JqueryMobile_Manual
P. 110

110

                                                    Style the flip switch
                                             tryjqmob_forms_select_switch_css.html
               <!DOCTYPE html>
               <html>
               <head>
               <meta name="viewport" content="width=device-width, initial-scale=1">
               <link rel="stylesheet" href="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
               <script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
               <script src="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
               <style>
               /* Custom indentations are needed because the length of custom labels differs from
                  the length of the standard labels */
               .custom-size-flipswitch.ui-flipswitch .ui-btn.ui-flipswitch-on {
                   text-indent: -4em;
               }
               .custom-size-flipswitch.ui-flipswitch .ui-flipswitch-off {
                   text-indent: 2em;
               }
               /* Custom widths are needed because the length of custom labels differs from
                  the length of the standard labels */
               .custom-size-flipswitch.ui-flipswitch {
                   width: 8.875em;
               }
               .custom-size-flipswitch.ui-flipswitch.ui-flipswitch-active {
                   padding-left: 7em;
                   width: 1.875em;
               }
               </style>
               </head>
               <body>

               <div data-role="page">
                 <div data-role="main" class="ui-content">
                   <form method="post" action="/action_page_post.php">
                     <label for="switch">Flip Toggle Switch:</label>
                       <input type="checkbox" data-role="flipswitch" name="switch" id="switch" data-wrapper-
               class="custom-size-flipswitch">
                       <br>
                     <input type="submit" data-inline="true" value="Submit">
                   </form>
                 </div>
               </div>

               </body>
               </html>
   105   106   107   108   109   110   111   112   113   114   115