Can you please take a look at this demo and let me know how to detect when .draggable
hits top and bottom of it's containment?
$(function(){
var draggableRight;
var draggableWidth = $('.draggable').height();
var parentWidth = $('#parent').height();
$('.draggable').draggable({
containment: 'parent',
axis: "y",
drag: function(e, ui){
// ==> if .draggable hits top of parent change it's background red
// $(document).trigger("mouseup");
// $('.draggable').css({ background: 'red' });
// ==> if .draggable hits bottom of parent change it's background blue
// $(document).trigger("mouseup");
// $('.draggable').css({ background: 'blue' });
}
});
});