after dragging up, animate viewport up and after dragging down, animate viewport down...
Posted
by Luis
on Stack Overflow
See other posts from Stack Overflow
or by Luis
Published on 2010-06-09T03:48:03Z
Indexed on
2010/06/09
3:52 UTC
Read the original article
Hit count: 250
I been trying to make this work for the last couple of days, I'm a new into web designing so I hope someone can help me out with this. I'm trying to run an animation after dragging the div container depending if the user is dragging up or down. This is the code that Im working on.
this is the code when calling the jquery widget
$ $('#container').draggable({scroll:true, axis: 'y', //scrollSensitivity: 1000,
stop: function(event, ui) {
if(scrollY <= 0){
$('#container').animate({
top: '-2000px'
}, 500);
}
if(scrollY -= 0){
$('#container').animate({
top: '0'
}, 500);
}
}
});
© Stack Overflow or respective owner