Open In App

jQWidgets jqxPanel theme Property

Last Updated : 23 May, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

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 jqxPanel is used to illustrate a jQuery panel widget which is a holder for different widgets or elements. Moreover, it intuitively appends horizontal as well as vertical scrollbars, in case the stated content is not completely viewable.

The theme property is used to set or return the theme for the jqxPanel widget. It accepts string type values and its default value is empty (”). In order to use this property, we need to incorporate the theme stylesheet i.e. (jqx.energyblue.css) into the header section. The theme file is included after the jqx.base.css file.

Syntax:

Set the theme Property.

$("#Selector").jqxPanel({ theme: String });

Return the theme Property.

var theme = $('#Selector').jqxPanel('theme');

Linked Files: Download jQWidgets from the given link. In the HTML file, locate the script files in the downloaded folder.

<link rel=”stylesheet” href=”jqwidgets/styles/jqx.base.css” type=”text/css” />
<link rel=”stylesheet” href=”jqwidgets/styles/jqx.energyblue.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/jqxbuttons.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxscrollbar.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxpanel.js”></script>

Example: The below example illustrates the jqxPanel theme Property in jQWidgets.

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">
    <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/jqxbuttons.js">
    </script>
    <script type="text/javascript" 
        src="jqwidgets/jqxscrollbar.js">
    </script>
    <script type="text/javascript" 
        src="jqwidgets/jqxpanel.js">
    </script>
</head>
<body>
    <center>
        <h1 style="color:green">
            GeeksforGeeks
        </h1>
        <h3>jQWidgets jqxPanel theme Property</h3>
        <div id='jqxp' style="font-size:15px; 
            font-family:Verdana; float:center;">
            <div style='margin-top: 12px;'>
                <h3>Topics covered by GeeksforGeeks</h3>
            </div>
            <div style="white-space: nowrap; text-align: left;">
                <ul>
                    <li>Theory Of Computation</li>
                    <li>C Programming</li>
                    <li>Datastructure</li>
                    <li>javascript</li>
                    <li>Algorithm</li>
                    <li>Python</li>
                    <li>JQuery</li>
                    <li>Scala</li>
                    <li>Java</li>
                    <li>Html</li>
                    <li>C++</li>
                </ul>
            </div>
        </div>
        <div>
            <input type="button" id="jqxBtn" 
                style="margin-top: 25px" value="Click here"/>
        </div>
        <br>
        <div id="log"></div>
    </center>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#jqxp").jqxPanel({
                width: "180px",
                height: "170px",
                theme: 'energyblue',
            });
            $("#jqxBtn").jqxButton({
                width: "180px",
                height: "30px",
                theme: 'energyblue',
            });
            $("#jqxBtn").on("click", function () {
                var t = $('#jqxp').jqxPanel('theme');
                $('#log').html("Theme name: " + t);
            });
        });
    </script>
</body>
</html>


Output:

 

Reference: https://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxpanel/jquery-panel-api.htm?search=



Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads