1

I dont understand what "100" means. Is it 100 pixels per second, ms? This code is taken from : https://jqueryui.com/draggable/#scroll

<!doctype html>
<html lang="en">
<head>

  <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
  <link rel="stylesheet" href="/resources/demos/style.css">
  <style>
   #draggable, #draggable2, #draggable3 { width: 100px; height: 100px; padding: 0.5em; float: left;        margin: 0 10px 10px 0; }
  </style>
  <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
  <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
  <script>
  $( function() {
    $( "#draggable3" ).draggable({ scroll: true, scrollSpeed: 100 });
  } );
  </script>
</head>
<body>

<div id="draggable3" class="ui-widget-content">
 <p>scrollSpeed set to 100</p>
</div>

<div style="height: 5000px; width: 1px;"></div>


</body>
</html>
sao
  • 1,835
  • 6
  • 21
  • 40
M.T
  • 303
  • 4
  • 15
  • It's probably just a proportion of some arbitrary maximum, and not tied to specific units. Is there some reason you need units? – isherwood Nov 11 '19 at 18:08

2 Answers2

2

Jquery scrollSpeed is always determined in steps. Which means each scroll at the associated scrollSpeed will be how many pixels up or down the user will go. One scroll = one step.

For example: 100 scrollSpeed means every step is 100px per 600-800ms. Although there is a lot of variance in this measure

The measure of scrollSpeed is a number on a scale to 1000 (max)

Keep in mind scrollSpeed is also controlled primarily by the browser which the end-user is on. So getting pixels/second is a tough measurement, especially when user-input varies per scroll.

Ex. Chrome may be different than Safari

In the post below they mention how to regulate to pixels/second scroll speed:

Slowing the speed of a Jquery Scroll

-1
scrollSpeed 
Type: Number
Default: 20
The speed at which the window should scroll once the mouse pointer gets within the scrollSensitivity distance. Ignored if the scroll option is false.
Code examples:
Initialize the draggable with the scrollSpeed option specified:
Grumpy
  • 2,140
  • 1
  • 25
  • 38