Skip to content
Related Articles

Related Articles

jQuery Mobile Collapsible collapse Events

View Discussion
Improve Article
Save Article
Like Article
  • Last Updated : 15 Dec, 2021

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.


  • 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=””>
<script src=””></script>
<script src=””></script>

Example: This example describes the jQuery Mobile Collapsible collapse Event.


<!doctype html>
<html lang="en">
    <link rel="stylesheet" href=
    <script src=
    <script src=
        $(document).ready(function () {
            $("#GFG").on("collapsiblecollapse", function (event, ui) {
                alert("Collapsible Widget Content Collapsed")
    <div data-role="page" id="page1">
        <div data-role="header">
            <h3>jQuery Mobile Collapsible collapse Event</h3>
        <div role="main" class="ui-content">
            <div data-role="collapsible" 
                style="width: 400px;" id="GFG">
                    GeeksforGeeks is a computer science portal
                    for geeks. It contains well written, well
                    thought and well explained computer science
                    and programming articles, quizzes etc.


Collapsible collapse Events


My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!