0

In a mousewheel event handler, I changed a statement that updates a element's scrollTop:

-        list.scrollTop(newScrollTop);
+        list.animate({
+            scrollTop: newScrollTop
+        }, 80); 

I added this animate to make the list scroll smoothly, and it works on Chrome like the original statement.

But on IE7, the animate version make the scroll unusable, when I scroll, the list move only some 10px on the screen.

What could possibly be the reason of this?

satoru
  • 31,822
  • 31
  • 91
  • 141
  • It moves 10px, and then stops? – Šime Vidas Nov 07 '12 at 02:10
  • @Šime Vidas Not exactly. It's just a little movement. The result of this effect is that a IE7 user has to scroll a lot to make the `list` move a little. – satoru Nov 07 '12 at 02:46
  • It could be that the `animate` function chokes in IE7. That wouldn't surprise me since IE7's JavaScript performance is very slow compared to modern browsers. – Šime Vidas Nov 07 '12 at 13:27
  • @Šime Vidas I guess it should be about `scrollTop`, because we have been using `animate` on other elements and they all works. – satoru Nov 08 '12 at 00:26
  • How much does each `newScrollTop` invocation scroll the contents? Maybe you just need a larger value for IE7. – Šime Vidas Nov 08 '12 at 00:29
  • @Šime Vidas Yes, I've tried this and it works, I just don't know why. – satoru Nov 08 '12 at 02:05

0 Answers0