Change value of flip toggle dynamically with jQuery Mobile
问题 I'm working with jQuery Mobile, and I save some settings in a cookie. When the settings page is reloaded, I read the cookie to set all the values. I'm having trouble setting the flip toggle switch. Most elements just have to trigger the keyup or changed events, but I'm not sure how the flip toggles gets its value from the select box. Any ideas? 回答1: After you change the value of the switch you have to refresh it for the animation to toggle: $('#Switch2').val('on').slider("refresh"); 回答2: It