jquery scroll speeds -


I am using the following code to scroll a layer according to the position of the mouse:

 . $ (". Mouse") Chetan ({scrollTo: x}, duration);  

Although this works, I think the speed of the scroll is very fast when you move to the right. It also noted that if the scroller starts to the left and scrolls to the right and Then scrolls a little bit, then it's actually really slow. I'm thinking that the function scroll speed is not best controlled using the term logic, but I'm not sure how the speed is Be controlled. Where is the scroll bar, I would like a constant speed

Any hint?

Thanks

topicprop = "text">

The problem is this is a duration, not a speed that you Are going, so you need to determine the distance you need:

  $ (". Icons"). Value ({scrollLeft: x}, duration);} ({{{{{{{{scrollLeft: x}};} {var period = math. ($ (This) .scrollLeft () - x) $ 2; );  

You can adjust that constant as necessary, but this is the basic base, the distance you need to move (absolute value) and the number of pixels Multiply multiple times if necessary, some millisecond per-pixel.


Comments