Skip to content
Related Articles

Related Articles

jQWidgets jqxKnob allowValueChangeOnMouseWheel Property

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

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 jqxKnob is used for representing a jQuery plugin having a round shape and displaying a draggable indicator within a range of the specified values. This API can also be used in a table or matrix for showing the relative value of a field in a range of values in the specified data region.

The allowValueChangeOnMouseWheel property is used for setting or getting whether the value of the specified jqxKnob can be changed on the mouse wheel or not.

Syntax:

  • For setting the allowValueChangeOnMouseWheel property.
$('#jqxKnob').jqxKnob({allowValueChangeOnMouseWheel: true });
  • For getting the allowValueChangeOnMouseWheel property.
var allowValueChangeOnClick = 
$('#jqxKnob').jqxKnob('allowValueChangeOnMouseWheel');

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” />
<script type=”text/javascript” src=”scripts/jquery.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/jqxdraw.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxknob.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxnumberinput.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqx-all.js”></script>

Example: The below example illustrates the jQWidgets jqxKnob allowValueChangeOnMouseWheel property.

HTML




<!DOCTYPE html>
<html lang="en">
  
<head>
    <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/jqxbuttons.js">
    </script>
    <script type="text/javascript" 
            src="jqwidgets/jqxdraw.js">
    </script>
    <script type="text/javascript" 
            src="jqwidgets/jqxknob.js">
    </script>
    <script type="text/javascript" 
            src="jqwidgets/jqxnumberinput.js">
    </script>
    <script type="text/javascript" 
            src="jqwidgets/jqx-all.js">
    </script>
</head>
<body>
    <center>
        <h1 style="color:green;">
            GeeksforGeeks
        </h1>
        <h3>
            jQWidgets jqxKnob 
            allowValueChangeOnMouseWheel Property
        </h3>
        <div id='jqx_Knob'>
            <center>
                GeeksforGeeks
            </center>
        </div>
  
        <input type="button" style="margin:65px;" 
            id="button_for_allowValueChangeOnMouseWheel"
            value="Value of the allowValueChangeOnMouseWheel property"/>
        <div id="log"></div>
  
        <script type="text/javascript">
            $(document).ready(function () {
                $('#jqx_Knob').jqxKnob({
                    value: 5,
                    min: 0,
                    max: 50,
                    startAngle: 0,
                    endAngle: 360,
                    snapToStep: true,
                    allowValueChangeOnMouseWheel: true,
                    marks: {
                        colorRemaining: { color: 'red' },
                        colorProgress: { color: 'green' },
                        offset: '70%',
                        thickness: 5,
                        size: '4%'
                    },
                    labels: {
                        offset: '85%',
                        step: 5
                    },
                    progressBar: {
                        style: { fill: 'yellow', 
                                 stroke: 'black' },
                        size: '8%',
                        offset: '61%',
                        background: { fill: 'black' }
                    },
                    pointer: { type: 'arrow', 
                              style: { fill: 'green' }, 
                              size: '68%', 
                              offset: '29%', 
                              thickness: 15 }
                });
  
                $("#button_for_allowValueChangeOnMouseWheel")
                .jqxButton({
                    width: 350,
                    theme: 'energyblue'
                });
  
                $('#button_for_allowValueChangeOnMouseWheel')
                .jqxButton().click(function () {
                    var value_of_allowValueChangeOnMouseWheel =
                        $('#jqx_Knob').jqxKnob(
                        'allowValueChangeOnMouseWheel');
  
                        $("#log").html(
                        value_of_allowValueChangeOnMouseWheel);
                })
            });
        </script>
    </center>
</body>
</html>


Output:

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


My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!