bibMoxabrardy
New Member
I have a set of 2 radio buttons that change the device orientation when changed.The issue I am having is that when the I select the landscape radio button, it works, however when I reselect the portrait one, I get an alert Landscape and it remains the same.Here is my try:HTML:\[code\]<fieldset data-role="controlgroup"><input type="radio" name="orientation" id="portrait" value="http://stackoverflow.com/questions/14073673/1" checked /><label for="portrait">Portrait</label><input type="radio" name="orientation" id="landscape" value="http://stackoverflow.com/questions/14073673/2" /><label for="landscape">Landscape Mode</label> </fieldset> \[/code\]JS:\[code\]$("input[name='orientation']").change(function() { if ($("input[name='orienation']:checked").val() == '1') { navigator.screenOrientation.set('portrait'); alert('portrait'); } else if ($("input[name='orienation']:checked").val() == '2') { navigator.screenOrientation.set('landscape'); alert('landscape'); } })\[/code\]I am using jQuery and jQuery Mobile