![]() |
VOOZH | about |
jQuery Mobile is a web-based technology used to make responsive content that can be accessed on all smartphones, tablets, and desktops. In this article, we will be using the jQuery Mobile Collapsible collapse event to trigger when a collapsible widget is collapsed.
Syntax:
Initialize the collapsible with the collapse callback specified:
$( ".selector" ).collapsible({
expand: function( event, ui ) {}
});Bind an event listener to the collapsiblecollapse event:
$( ".selector" ).on( "collapsiblecollapse",
function( event, ui ) {} );CDN Link: First, add jQuery Mobile scripts needed for your project.
<link rel="stylesheet" href="https://code.jquery.com/mobile/1.5.0-alpha.1/jquery.mobile-1.5.0-alpha.1.min.css">
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script src="https://code.jquery.com/mobile/1.5.0-alpha.1/jquery.mobile-1.5.0-alpha.1.min.js"></script>
Example: This example describes the jQuery Mobile Collapsible collapse Event.
Output:
👁 Collapsible collapse EventsReference: https://api.jquerymobile.com/collapsible/#event-collapse