Skip to content

Instantly share code, notes, and snippets.

@commadelimited
Created January 19, 2012 17:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save commadelimited/1641314 to your computer and use it in GitHub Desktop.
Save commadelimited/1641314 to your computer and use it in GitHub Desktop.
Refreshing jQuery Mobile widgets
<div data-role="fieldcontain">
<label for="toggle">Flip switch:</label>
<select name="toggle" id="toggle" data-role="slider">
<option value="off">Off</option>
<option value="on">On</option>
</select>
</div>
var myswitch = $("#toggle");
myswitch[0].selectedIndex = 1;
myswitch .slider("refresh");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment