![]() |
VOOZH | about |
jQuery Mobile is a Web-technology built on top of jQuery. It is used to make responsive content that can be accessed on a variety of devices like tabs, mobiles, and desktops.
In this article, we will be using the jQuery Mobile Popup beforeposition event that is triggered before the popup computes the coordinates where it will appear.
Syntax:
Initialize the popup with the beforeposition callback specified:
$( ".selector" ).popup({
beforeposition: function( event, ui ) {
// Your code goes here
}
});Bind an event listener to the popupbeforeposition event:
$( ".selector" ).on( "popupbeforeposition", function( event, ui ) {} );Parameters: It accepts a callback function that holds two parameters:
CDN Links:
<link rel="stylesheet" href="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" />
<script src="https://code.jquery.com/jquery-2.1.3.js"></script>
<script src="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.js"></script>
Example: This example describes the uses of jQuery Mobile Popup beforeposition event.
Output:
👁 jQuery Mobile Popup beforeposition EventReference: https://api.jquerymobile.com/popup/#event-beforeposition