aterrien / jQuery-Knob

Nice, downward compatible, touchable, jQuery dial
http://anthonyterrien.com/knob/
MIT License
5.03k stars 1.24k forks source link

Disable scroll wheel behavior #46

Open cborgia opened 12 years ago

cborgia commented 12 years ago

Thank you for the plugin, quick question:

Anyway to turn off the scroll wheel behavior? To be clear, I do not want to disable, I want the UI to not be impacted by a users scroll.

The problem now: if a user scrolls the webpage, and their mouse is ends up over a jQuery-Knob (accidentally as they scroll) the page scrolling stops and the knob UI changes. This is not the desired intent of the user.

balexandre commented 12 years ago

just set readOnly property to true

example:

    $(".blueCircle").knob({
        'min':0,
        'max':100,
        'readOnly': true,
        'width': 80,
        'height': 80,
        'fgColor': '#88BBC8',
        'dynamicDraw': true,
        'thickness': 0.2,
        'tickColorizeValues': true
    })

website example: http://themes.suggeelson.com/?theme=supr (just click the login button, it's a demo)

trishik commented 11 years ago

in which file should i fond this code ?

fson commented 10 years ago

I came here looking for an answer to the same question. I would like to be able to just disable the scroll wheel behavior because it interferes with normal scrolling on the page. I want to keep the click and drag functionality, so making the dial readOnly is not an option.

Is there a way to only disable adjusting with scroll wheel?

kosmotaur commented 10 years ago

The scrolling feature is messing with things when a user scrolls the page and the knob happens to pass through the cursors position. The value is then changed accidentally and not relevantly to the users intention, which definitely poses a UX issue. Please make the change value by scrolling feature an option.

cekerholic commented 10 years ago

@cborgia @fson @kosmotaur try using this #135. Works perfectly for me

peterjwest commented 10 years ago

Bump, I would appreciate this feature.

theWill commented 10 years ago

bump, need this feature too!

theWill commented 10 years ago

work-around for this feature is to edit the jquery.knob.js file around like 660-661: this.$c.bind("mousewheel DOMMouseScroll", mw); this.$.bind("mousewheel DOMMouseScroll", mw);

take the above lines and comment them out to be like so: //this.$c.bind("mousewheel DOMMouseScroll", mw); //this.$.bind("mousewheel DOMMouseScroll", mw)

Hope this helps someone.

axelvillamil commented 9 years ago

^ @theWill is a good person...thank you