Is it possible to use a single jQuery mobile widget within a non-mobile web page? -


i using jquery ui put widgets on web page designed large screens. looking flipswitch widget, , found 1 provided jquery mobile framework.

is possible use jquery mobile make flipswitch widget work, without whole jquery mobile theming ?

you can use jquery mobile's widgets creating custom build. have choose widgets want, , load js library style sheets in head. need modify style sheets, either modifying them manually or using themeroller.

html

<head>   <link rel="stylesheet" href="structure.css" />   <link rel="stylesheet" href="theme.css" />   <script src="jquery-1.11.1.min.js"></script>   <script src="custom-build.js"></script> </head> <body>   <form>     <label for="flip-checkbox-1">flip toggle switch checkbox:</label>     <input type="checkbox" data-role="flipswitch" name="flip-checkbox-1" id="flip-checkbox-1">   </form> </body> 

to initialize widget, call .flipswitch() on .ready(). more methods, check widget's api.

$(function () {   $("#flip-checkbox-1").flipswitch(); }); 

demo


Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -