| 1 |
<!doctype html> |
| 2 |
<html lang="en"> |
| 3 |
<head> |
| 4 |
<meta charset="utf-8"> |
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1"> |
| 6 |
<title>jQuery UI Draggable - Auto-scroll</title> |
| 7 |
<link rel="stylesheet" href="../../themes/base/all.css"> |
| 8 |
<link rel="stylesheet" href="../demos.css"> |
| 9 |
<style> |
| 10 |
#draggable, #draggable2, #draggable3 { width: 100px; height: 100px; padding: 0.5em; float: left; margin: 0 10px 10px 0; } |
| 11 |
</style> |
| 12 |
<script src="../../external/requirejs/require.js"></script> |
| 13 |
<script src="../bootstrap.js"> |
| 14 |
$( "#draggable" ).draggable({ scroll: true }); |
| 15 |
$( "#draggable2" ).draggable({ scroll: true, scrollSensitivity: 100 }); |
| 16 |
$( "#draggable3" ).draggable({ scroll: true, scrollSpeed: 100 }); |
| 17 |
</script> |
| 18 |
</head> |
| 19 |
<body> |
| 20 |
|
| 21 |
<div id="draggable" class="ui-widget-content"> |
| 22 |
<p>Scroll set to true, default settings</p> |
| 23 |
</div> |
| 24 |
|
| 25 |
<div id="draggable2" class="ui-widget-content"> |
| 26 |
<p>scrollSensitivity set to 100</p> |
| 27 |
</div> |
| 28 |
|
| 29 |
<div id="draggable3" class="ui-widget-content"> |
| 30 |
<p>scrollSpeed set to 100</p> |
| 31 |
</div> |
| 32 |
|
| 33 |
<div style='height: 5000px; width: 1px;'></div> |
| 34 |
|
| 35 |
<div class="demo-description"> |
| 36 |
<p>Automatically scroll the document when the draggable is moved beyond the viewport. Set the <code>scroll</code> option to true to enable auto-scrolling, and fine-tune when scrolling is triggered and its speed with the <code>scrollSensitivity</code> and <code>scrollSpeed</code> options.</p> |
| 37 |
</div> |
| 38 |
</body> |
| 39 |
</html> |