Skip to content
Related Articles

Related Articles

jQWidgets jqxResponsivePanel isCollapsed() Method

View Discussion
Improve Article
Save Article
Like Article
  • Last Updated : 17 Nov, 2021

jQWidgets is a JavaScript framework for making web-based applications for PC and mobile devices. It is a very powerful, optimized, platform-independent, and widely supported framework. The jqxResponsivePanel is a jQuery widget that is used to represent a panel widget with responsive behavior. The responsive panel is used to display the content in a responsive manner. This panel collapses when the width of the browser window is less than a set value and after clicking the button, we can access the value.

The isCollapsed() method returns a Boolean value of the widget. It returns true or false if the panel is collapsed or expanded. It does not accept any parameter and return a Boolean value.

Syntax:

$('Selector').jqxResponsivePanel('isCollapsed');

Linked Files: Download jQWidgets from the link https://www.jqwidgets.com/download/. In the HTML file, locate the script files in the downloaded folder.

<link rel=”stylesheet” href=”jqwidgets/styles/jqx.base.css” type=”text/css” />
<script type=”text/javascript” src=”scripts/jquery-1.11.1.min.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxcore.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqx-all.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxresponsivepanel.js”></script>

The below example illustrates the jqxResponsivePanel isCollapsed() method in jQWidgets.

Example:

HTML




<!DOCTYPE html>
<html lang="en">
  
<head>
    <link rel="stylesheet" 
          href="jqwidgets/styles/jqx.base.css" 
          type="text/css" />
    <link rel="stylesheet" 
          href="jqwidgets/styles/jqx.energyblue.css" 
          type="text/css" />
    <script type="text/javascript" 
            src="scripts/jquery-1.11.1.min.js">
    </script>
    <script type="text/javascript" 
        src="jqwidgets/jqxcore.js">
    </script>
    <script type="text/javascript" 
        src="jqwidgets/jqx-all.js">
    </script>
    <script type="text/javascript" 
        src="jqwidgets/jqxresponsivepanel.js">
    </script>
  
    <style>
        h1,
        h3 {
            text-align: center;
        }
          
        #GFG {
            width: 100%;
            margin: 0 auto;
        }
    </style>
</head>
  
<body>
    <h1 style="color: green;">
        GeeksforGeeks
    </h1>
  
    <h3>
        jQWidgets jqxResponsivePanel isCollapsed() Method
    </h3>
  
    <center>
        <input type="button" id="jqxBtn" 
            value="Check isCollapsed Widget" 
            style="padding: 5px 15px;">
    </center>
              
    <div id="GFG" style="width: 400px;">
        <div id="TRP"></div>
        <div id="jqxRP" style="padding: 5px;">
            <h4>HTML</h4>
            <p>
                HTML stands for HyperText Markup 
                Language. It is used to design 
                web pages using a markup language. 
                HTML is the combination of Hypertext 
                and Markup language. Hypertext 
                defines the link between the web pages.
            </p>
  
        </div>
    </div>
  
    <script type="text/javascript">
        $(document).ready(function() {
            $('#jqxRP').jqxResponsivePanel({
                width: 400,
                height: 250,
                toggleButton: $('#TRP')
            });
  
            $('#jqxBtn').on('click', function () {
                var col = $('#jqxRP')
                    .jqxResponsivePanel('isCollapsed');
  
                alert("Is Collapsed: " + col);
            });
        });
    </script>
</body>
  
</html>

Output:

Reference: https://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxresponsivepanel/jquery-responsive-panel-api.htm


My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!