Reputation: 797
Here an example http://jsfiddle.net/7aVXc/
Let' say current image height is 400px
.
How do I stop the image when the white background is appear on top and bottom?
Upvotes: 0
Views: 164
Reputation: 16115
E.g. add a drag
-handler which returns true
or false
relative to the vertical position:
$("#image").draggable({
...
drag:function(event,ui) {
return (ui.offset.top > -235 && ui.offset.top < 15);
}
});
Also see this example.
Upvotes: 1