javascript - Iscroll mousewheel scrolling works slow in firefox than Google Chrome - Stack Overflow

Please check this example link: If i run above example page in chrome and scroll through mousewheel, t

Please check this example link: /

If i run above example page in chrome and scroll through mousewheel, the page goes up by 100px every time. You can see there is Y position printed. If i run same above page in firefox 26.0 and scroll through mousewheel, the page goes up by 3px every time. You can see that page goes up very slow in firefox. Is there any way to fix them?

Please check this example link: http://lab.cubiq/iscroll5/demos/probe/

If i run above example page in chrome and scroll through mousewheel, the page goes up by 100px every time. You can see there is Y position printed. If i run same above page in firefox 26.0 and scroll through mousewheel, the page goes up by 3px every time. You can see that page goes up very slow in firefox. Is there any way to fix them?

Share Improve this question asked Jan 10, 2014 at 9:11 Rajnikant KakadiyaRajnikant Kakadiya 2,2651 gold badge24 silver badges30 bronze badges 5
  • As you are using a javascript to scroll I think the problem lies within your javascript – RononDex Commented Jan 10, 2014 at 9:14
  • 2 I am usigng iscroll v5.0 plugin for stylish scroll. iscroll v4.0 working fine in both browser. – Rajnikant Kakadiya Commented Jan 10, 2014 at 9:16
  • I saw this: function updatePosition () { position.innerHTML = this.y>>0; } >> should be > which might be problem – Bhojendra Rauniyar Commented Jan 10, 2014 at 9:18
  • 2 Please try by mousewheel scrolling in firefox. It scrolls very slow. I don't know why? – Rajnikant Kakadiya Commented Jan 10, 2014 at 9:22
  • 1 wheel value for delta is implemented per browser and OS very different ways, some of them are event reversed, some are accelerated, it all depends on the platform unfortunately. This is one of the examples of what is happening when some "standard" is not there in W3C, and all vendors do whatever they want, so inconsistency es here. – moka Commented Jan 14, 2014 at 18:01
Add a ment  | 

2 Answers 2

Reset to default 5

This is a problem with the iscrolljs library, as reported 8 days ago on the github site for iscroll. Please refer to: https://github./cubiq/iscroll/issues/577

If you debug the code on Firefox you will see that deltaY is being adjusted only by -3 each time a scroll event occurs. This is different to chrome which has a very large deltaY adjustment on scroll.

I would suggest waiting until a patch is supplied. If your need is urgent then I would remend using the older version until a fix is available.

As I didn't have the option of reverting to an older version, I looked through the GitHub issue mentioned by Metalskin and I saw a temporary fix by a poster called 'justnorris'.

He modified the _wheel method in the iscroll-probe.js file directly at lines 1055 - 1057, with the following:

    if ( 'deltaX' in e ) {
        var multiply = ( e.deltaMode === 1 ) ? this.options.mouseWheelSpeed : 1;
        wheelDeltaX = -e.deltaX * multiply;
        wheelDeltaY = -e.deltaY * multiply;
    } 

Source: https://github./cubiq/iscroll/issues/577#issuement-33715370

Do a Ctrl+F5 (cache clear) of your page in Firefox and it should scroll fine now.

Note: This is a temporary working fix. Works for me as of today, on Firefox 27.0.1, Windows 8.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744407885a4572723.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信