Documentation
Getting Started
jqxResponsivePanel represents a panel widget with a responsive behaviour. The responsive panel collapses when the browser window's width becomes less than a set value (collapseBreakpoint) and the panel is then accessible by clicking a button.Every UI widget from jQWidgets toolkit needs its JavaScript files to be included in order to work properly.
The first step is to create html page and add links to the javascript files and css dependencies to your project. The jqxResponsivePanel widget requires the following files:
<head> <link type="text/css" rel="Stylesheet" href="../jqwidgets/styles/jqx.base.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/jqxresponsivepanel.js"></script><script async src="https://www.googletagmanager.com/gtag/js?id=G-2FX5PV9DNT"></script><script>window.dataLayer = window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'G-2FX5PV9DNT');</script></head>
The next step is to create two Div elements within the body of the html document - one for the toggle button and one for the panel itself.
<div id="toggleResponsivePanel"></div><div id="jqxResponsivePanel"></div>
The last step is to initialize the widget by adding the following script to the html document:
<script type="text/javascript"> $(document).ready(function () { $('#jqxResponsivePanel').jqxResponsivePanel({ width: 250, height: 400, collapseBreakpoint: 800, toggleButton: $('#toggleResponsivePanel') }); });</script>
To call a function (method), you need to pass the method name and parameters (if any) in the jqxResponsivePanel’s constructor.
To set a property (option), you need to pass the property name and value(s) in the jqxResponsivePanel's constructor.$('#jqxResponsivePanel').jqxResponsivePanel('open');
To get a property (option), you need to pass the property name to the jqxResponsivePanel's constructor.$('#jqxResponsivePanel').jqxResponsivePanel({ collapseBreakpoint: 1000 });
To bind to an event of a UI widget, you can use basic jQuery syntax. Let’s suppose that you want to know when the responsive panel has been collapsed.var collapseBreakpoint = $('#jqxResponsivePanel').jqxResponsivePanel('collapseBreakpoint');
// bind to 'collapse' event.$('#jqxResponsivePanel').on('collapse', function (event) {});
Basic Sample
<!DOCTYPE html><html lang="en"><head> <title>jQuery Responsive Panel Sample</title> <link type="text/css" rel="Stylesheet" href="../../jqwidgets/styles/jqx.base.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/jqxresponsivepanel.js"></script> <script type="text/javascript"> $(document).ready(function () { $('#jqxResponsivePanel').jqxResponsivePanel({ width: 250, height: 350, collapseBreakpoint: 500, toggleButton: $('#toggleResponsivePanel') }); }); </script><script async src="https://www.googletagmanager.com/gtag/js?id=G-2FX5PV9DNT"></script><script>window.dataLayer = window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'G-2FX5PV9DNT');</script></head><body style="width:400px;"> <div style="box-sizing: border-box; margin-bottom: 5px; width: 100%; height: 50px; padding: 10px 0 0 10px; background-color: #444444;"> <div id="toggleResponsivePanel"> </div> </div> <div id="jqxResponsivePanel" style="padding: 5px;"> <h4> jQWidgets</h4> <p> jQWidgets provides a comprehensive solution for building professional web sites and mobile apps. It is built entirely on open standards and technologies like HTML5, CSS, Javascript and jQuery. jQWidgets enables responsive web development and helps you create apps and websites that look beautiful on desktops, tablets and smart phones.</p> <p> jQWidgets is a feature complete framework with professional touch-enabled jQuery widgets, themes, input validation, drag & drop plug-ins, data adapters, built-in WAI-ARIA accessibility, internationalization and MVVM support.</p> </div></body></html>