Open In App

jQWidgets jqxScrollView refresh() Method

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 jqxScrollView is a jQuery widget that is used for viewing content that is wider than the visible area outlined by the device’s screen. A particular element can be chosen using the drag movements or by clicking/tapping on the buttons that are present at the bottom of the jqxScrollView widget.

The refresh() method is used to refresh the widget. It does not accept any parameter and does not return any value.

Syntax:

$("Selector").jqxScrollView('refresh');

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/jqxscrollview.js”></script>

The below example illustrates the jqxScrollView refresh() 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/jqxscrollview.js">
    </script>
  
    <style>
        h1,
        h3 {
            text-align: center;
        }
  
        #jqxSV {
            width: 100%;
            margin: 0 auto;
        }
    </style>
</head>
  
<body>
    <h1 style="color: green;">
        GeeksforGeeks
    </h1>
  
    <h3>
        jQWidgets jqxScrollView refresh() Method
    </h3>
  
    <center>
        <input type="button" id="jqxBtn" 
               value="refresh() Method" 
               style="padding: 5px 15px; margin: 10px;">
    </center>
  
    <div id="jqxSV">
        <img class="photo"
            alt="">
        <img class="photo"
            alt="">
        <img class="photo"
            alt="">
        <img class="photo"
            alt="">
    </div>
  
  
    <script type="text/javascript">
        $(document).ready(function () {
            $('#jqxSV').jqxScrollView({
                width: 450,
                height: 250,
                buttonsOffset: [0, 0]
            });
            $('#jqxBtn').on('click', function () {
                $("#jqxSV").jqxScrollView('refresh');
                alert("Refresh the widget");
            });
        });
    </script>
</body>
  
</html>


Output:

Reference: https://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxscrollview/jquery-scrollview-api.htm



Last Updated : 24 Nov, 2021
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads