Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 46 lines (35 sloc) 0.933 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
<style>
#dragAndScroll {
padding-left: 30px;
border: 2px solid #aaa;
list-style: decimal;
overflow: auto;
height: 200px;
width: 300px;
}
</style>

<p>
Start dragging the element that says "drag me up!" The scroller should start working despite your mouse already being in the "scroll area" defined by Scroller.
</p>

<ol id="dragAndScroll">
</ol>


<script src="/depender/build?require=More/Drag.Move,More/Scroller,More/Fx.Scroll,More/Sortables"></script>

<script>

var dragAndScroll = $('dragAndScroll');

for (var i = 0; i < 100; i++){
new Element('li', {id: 'li' + i, text: 'Moo'}).inject(dragAndScroll);
}

new Fx.Scroll(dragAndScroll).toElement('li19');
$('li20').set('html', 'drag me up!');

var scroller;
new Sortables('dragAndScroll', {
clone: true,
opacity: 0.5,
onStart: function(){
scroller = new Scroller(dragAndScroll, {area: 50}).start();
},
onComplete: function(){
scroller.stop();
}
});

</script>
Something went wrong with that request. Please try again.