diff --git a/README.md b/README.md index 05006fa..1183022 100755 --- a/README.md +++ b/README.md @@ -40,6 +40,7 @@ Behaviors : * angleArc : arc size in degrees | default=360. * stopper : stop at min & max on keydown/mousewheel | default=true. * readOnly : disable input and events | default=false. +* scroll : disable reaction to mouse scrollwheel | default=true. UI : * cursor : display mode "cursor", cursor size could be changed passing a numeric value to the option, default width is used when passing boolean value "true" | default=gauge. @@ -129,4 +130,4 @@ Set the value Supported browser ------- -Tested on Chrome, Safari, Firefox, IE 9.0. \ No newline at end of file +Tested on Chrome, Safari, Firefox, IE 9.0. diff --git a/js/jquery.knob.js b/js/jquery.knob.js index d6fa7b7..5d0f50b 100755 --- a/js/jquery.knob.js +++ b/js/jquery.knob.js @@ -93,6 +93,7 @@ max : this.$.data('max') || 100, stopper : true, readOnly : this.$.data('readonly') || (this.$.attr('readonly') == 'readonly'), + scroll : this.$.data('scroll') || true, // UI cursor : (this.$.data('cursor') === true && 30) @@ -629,8 +630,10 @@ } ); - this.$c.bind("mousewheel DOMMouseScroll", mw); - this.$.bind("mousewheel DOMMouseScroll", mw) + if (s.o.scroll) { + this.$c.bind("mousewheel DOMMouseScroll", mw); + this.$.bind("mousewheel DOMMouseScroll", mw); + } }; this.init = function () {