Search code examples
jqueryjquery-mobile-flipswitch

Jquery Flipswitch toggle for webapplication


I need flipswitch toggle for webapplication. I tried with existing scripts but it's changing all my page view into mobile view.

I need to implement flipswitch for webapplication with 2 options i.e; Histotic data and realtime data.

Please help me on this .


Solution

  • try this it is an jquery mobile controll you can use in Webapplication also

    You can use following

    <!DOCTYPE html>
    <html>
    <head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
    <script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
    <script src="http://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="demoform.asp">
          <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>