Skip to content
Related Articles
Open in App
Not now

Related Articles

jQuery Mobile panel close() Method

Improve Article
Save Article
  • Last Updated : 06 Jan, 2022
Improve Article
Save Article

jQuery Mobile is a framework for creating websites and web apps that are accessible on devices of various screen sizes like mobiles, tablets, laptops, and desktops. In this article, we will use the jQuery Mobile panel close() method to close an already opened panel. The panel close() method does not accept any arguments.



$(".selector").panel( "close" ); 

Parameters: This method does not accept any arguments.

CDN Links: First, add jQuery Mobile to your project.

<link rel=”stylesheet” href=”” />
<script src=””></script>
<script src=””></script>

Example: In the example below, we first open the panel using the panel open() method, and then we invoke the panel close() method after 3 seconds to close the panel.


<!DOCTYPE html>
<html lang="en">
    <meta charset="utf-8">
    <meta name="viewport" content=
          "width=device-width, initial-scale=1">
    <link rel="stylesheet" 
    <script src=
    <script src=
        function openPanel(){          
            // Close the panel after 3 seconds
            setTimeout(() => {
                // The close() method
            }, 3000);
    <div data-role="page">
        <div data-role="header" >
            <h1 style="color:green;">GeeksforGeeks</h1>
            <h3>jQuery Mobile Panel close() method</h3>
        <div role="main" class="ui-content">
                <button onclick="openPanel();"
                       Open Panel 
        <div data-role="panel" id="divID">
            <p>This is a panel</p>


jQuery Mobile panel close() Method


My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!