java - Save on off switch state when navigating to alternative area in app -
java - Save on off switch state when navigating to alternative area in app -
i making app iphones , android using 3rd party app maker, quite simple having issues 1 part in particular. in 1 folder there yes no switch, want create when user changes yes remain way no matter navigate next. have alternative utilize html css , java this. below code have set out far switch cant remain on no matter trying.
1) switch not remain on yes users remain in default alternative of no until specific user of app switches yes.
i not pro coder know basics of html , css advise , suggestions appreciated.
essentially thinking of using java cookie method, work ?
update:- http://jsfiddle.net/lucianlegion/dp4tj/100/
$(function () { var info = localstorage.getitem("showning"); if (data !== null) { $("input[name='onoffswitch']").attr("checked", "checked"); } }); $("input[name='onoffswitch']").click(function () { if ($(this).is(":checked")) { localstorage.setitem("showning", 1); } else { localstorage.removeitem("showning"); } });
i have managed work doesn't seem work when click button mobile phone thought why ?
java html css switch-statement state
Comments
Post a Comment