FlipSwitch jQuery mobile constructor -
FlipSwitch jQuery mobile constructor -
i'm looking way build new flipswitch command within container: <div id="container"/>
if run $("#container").flipswitch({ ontext:"stay", offtext:"go"});
html gets generated is:
<div class="ui-flipswitch ui-shadow-inset ui-bar-inherit ui-corner-all"> <a class="ui-flipswitch-on ui-btn ui-shadow ui-btn-inherit" href="#"/> <span class="ui-flipswitch-off"/> <div class="ui-flipswitch-input" id="container" tabindex="-1"/> </div>
which doesn't contain ontext/offtext labels.
do need manually create input
or select
html element within container or there improve way this?
thanks!
first create input element become flipswitch, append container div, , initialize widget:
var html = '<input type="checkbox" data-role="flipswitch" name="flip-checkbox-1" id="flip-checkbox-1">'; $("#container").append(html).find("input").flipswitch({ ontext:"stay", offtext:"go"});
demo
jquery jquery-mobile jquery-mobile-flipswitch
Comments
Post a Comment