This project is archived and is in readonly mode.

#1015 ✓ wontfix
Jean-Nicolas Boulay Desjardins

mousewheel should follow the speed of the wheel

Reported by Jean-Nicolas Boulay Desjardins | September 24th, 2010 @ 06:30 AM | in 1.3.1 (closed)

Hi,

I have been playing around with the "mousewheel" event and it seems that when I apply it to the "Slider" (Mootools More) the knob does not follow the speed of the mouse wheel compare to the plugin made for JQuery. I was wandering if it was in the plans of the next version of Mootools 1.3 to have the "mousewheel" event to get the speed at witch the wheel on the mouse is going. If not, could it be considered? Maybe create a new event like "mousewheellive" to get the speed at witch the mouse wheel is going.

Thanks you guys and great work.

Comments and changes to this ticket

  • Christoph Pojer

    Christoph Pojer September 24th, 2010 @ 06:47 AM

    • State changed from “new” to “duplicate”

    Moved to: https://mootools.lighthouseapp.com/projects/24057-mootoolsmore/tick...

    Please next time use the mootools-more bug tracker for mootools-more bugs.

  • Jean-Nicolas Boulay Desjardins

    Jean-Nicolas Boulay Desjardins September 24th, 2010 @ 07:02 AM

    • Tag changed from event mousewheel to event, mousewheel

    Wait, I though that the "mousewheel" was in the Mootools Core. Am I wrong?

  • Jan Kassens

    Jan Kassens September 24th, 2010 @ 10:01 AM

    • Milestone set to 1.3.1
    • State changed from “duplicate” to “open”
    • Milestone order changed from “799” to “0”

    It is in core: Event.js Line 47-49

    I also experienced weird speeds/wrong directions with event.wheel.

  • Christoph Pojer

    Christoph Pojer September 24th, 2010 @ 12:11 PM

    Not sure if it makes sense to wrap this in Core. Every browser reports different values for event.wheel (also, think: inertial scrolling on Mac OS). I've run into issues myself but I can't think of a good way to unify this. Any suggestions?

  • Jan Kassens

    Jan Kassens September 24th, 2010 @ 12:16 PM

    What are other frameworks doing with mousewheel events?

  • gonchuki

    gonchuki September 24th, 2010 @ 03:07 PM

    jQuery 1.4.2 - no native support at all, there's one generally accepted plugin that does some arcane magic on the wheel deltas

    YUI 3.2 - same as MooTools, simply attach the raw event data

    Prototype 1.7rc2 - no native support

    qooxdoo 1.2 - similar but different arcane magic as the jQuery plugin, the file is in event/type/MouseWheel.js in the qooxdoo SDK. Also does heavy (really heavy) browser sniffing for the normalization. They go to the extent of detecting whether it is Safari 5.0 or 5.0.1 source (edit by Jan Kassens: added link to source)

    Dojo - no native support, the Slider dijit (same in funtion as our -more Slider) uses the raw unmodified event data source.

  • Christoph Pojer

    Christoph Pojer September 24th, 2010 @ 03:17 PM

    • State changed from “open” to “wontfix”

    We don't do voodoo magic in core. This ticket still exists in the more tracker, let's see if the more team decides to work on this.

    @gonchuki huge thanks for looking into this, very much appreciated.

  • Jean-Nicolas Boulay Desjardins

    Jean-Nicolas Boulay Desjardins September 24th, 2010 @ 09:52 PM

    I am lost. So is going to be fix in core or more?

    Here is a small code I found that could help.

    http://adomas.org/javascript-mouse-wheel/test.html

    I am just not good enough with Mootools to hack this. But I would love to help, to the best of my abilities because I don't like that the Slider does not follow the speed the mouse wheel (I understand that "Slider" is in more but the event "mousewheel" is added in core).

    Again I am ready to help, but I need to know if it's a core issue or more issue.

  • Christoph Pojer

    Christoph Pojer September 24th, 2010 @ 09:57 PM

    I don't think we will fix this in core, if at all this will be directly fixed in Slider. As said, this ticket is still open in the more tracker

  • Jean-Nicolas Boulay Desjardins

    Jean-Nicolas Boulay Desjardins September 24th, 2010 @ 10:01 PM

    Here is a article on mouse wheel and the difference between browsers: http://adomas.org/javascript-mouse-wheel/

    In web years this article is a bit old, but it might help.

    Sorry, if I did not put this in the right place. I am just lost on where this should be put. Maybe there are other plugins that would need the "mousewheel" to be updated.

    Anyways thank you guys for putting your time to look into this. Lets make Mootools the best framework! ;)

  • Jean-Nicolas Boulay Desjardins

    Jean-Nicolas Boulay Desjardins September 24th, 2010 @ 10:02 PM

    Here is a article on mouse wheel and the difference between browsers: http://adomas.org/javascript-mouse-wheel/

    In web years this article is a bit old, but it might help.

    Sorry, if I did not put this in the right place. I am just lost on where this should be put. Maybe there are other plugins that would need the "mousewheel" to be updated.

    Anyways thank you guys for putting your time to look into this. Lets make Mootools the best framework!

  • Jean-Nicolas Boulay Desjardins

    Jean-Nicolas Boulay Desjardins September 24th, 2010 @ 10:05 PM

    In the more the ticket was changed to invalid by Jan Kassens. So it would be nice re-open it if we want to fix this.

  • Jan Kassens

    Jan Kassens September 24th, 2010 @ 10:16 PM

    • State changed from “wontfix” to “open”

    I'm reopening this ticket, since Core includes some normalization of the mousewheel (event.wheel). I think it should be either properly working or not be there at all.

    If the fix for a reasonable good normalization (read the direction and speed is about the same in all browsers) is going to be to big for core, I can see mousewheel as a more component.

  • gonchuki

    gonchuki September 24th, 2010 @ 10:34 PM

    The issue is (as I explained above), that proper normalization requires voodoo magic and heavy browser sniffing, a path that MooTools is not following anymore.
    I would leave the minimal support for mousewheel on -core (supporting the presence of the event is a "core" feature, the presence is normalized for all browsers), and possibly consider an extension plugin either on -more or the forge that concocts the required potions for a somewhat successful normalization of the wheel data.

  • Jean-Nicolas Boulay Desjardins

    Jean-Nicolas Boulay Desjardins September 24th, 2010 @ 11:08 PM

    • Tag cleared.

    Big debate! I did know it would turn this way.

    Here are some arguments on why I think Mootools needs it (I am not arguing if it should go in Core or More).

    1. Users expect to have the Slider follow the speed of the mouse wheel. Because on Mac and Windows when you wheel-it faster it takes affect on the slider...

    2. It could be apply to other plugins...

    3. I think this is apart of the expectation that developers have when they use the "mousewheel" event.

    4. Jan Kassens: "I also experienced weird speeds/wrong directions with event.wheel." So it seems that the support that Mootools Core as already is buggy...

  • Jean-Nicolas Boulay Desjardins
  • Christoph Pojer

    Christoph Pojer September 25th, 2010 @ 01:49 AM

    • State changed from “open” to “wontfix”

    Gonchuki said everything there is to say. I would agree to adding a plugin to More which uses evil browser sniffs that kinda work. But definitely not core. Providing a mouse wheel event is enough. Normalization cant be done in a reasonable way, that is why More is the right option.

  • Jean-Nicolas Boulay Desjardins

    Jean-Nicolas Boulay Desjardins February 17th, 2011 @ 01:45 AM

    @Christoph Common! Our friend Garrick solved it without browser sniffing.

    http://jsfiddle.net/jnbdz/LQksd/

    Slider.element.addEvent('mousewheel', function(event){
            var mode = (this.options.mode == 'horizontal') ? (event.wheel < 0) : (event.wheel > 0);
            this.set(this.step + (mode ? -1 : 1) * this.stepSize * Math.abs(event.wheel * 20));
            event.preventDefault();
        }.bind(Slider));
    

    For some reason it does not react the same in Safari (it does not accelerate but it still follows the speed) and I haven't tested in IE.

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Shared Ticket Bins

Pages