jquery mobile - Check if Popup is open then close it -
i using jquery mobile applicaion . in page have 5 popups shown above
<div data-role="popup" id="one" class="ui-content" data-theme="a"> </div> <div data-role="popup" id="two" class="ui-content" data-theme="a"> </div> <div data-role="popup" id="three" class="ui-content" data-theme="a"> </div>
my requirement , on click of device backup button , how can check if of popup open , close
i have tried code , not working
function homedeliverypagebackfunctionality() { if($("#one").hasclass("ui-popup-active")) { $( "#one" ).popup( "close" ); } if($("#two").hasclass("ui-popup-active")) { $( "#two" ).popup( "close" ); } if($("#three").hasclass("ui-popup-active")) { $( "#three" ).popup( "close" ); } }
if want close open popup:
$('[data-role="popup"]').popup("close");
Comments
Post a Comment