I'm trying to contain my draggable element so it cannot be dragged outside of the viewable window, which works well if the user is at the top of the page, however if you scroll down at all then it messes it all up.
How can I do this?
$(".chat-wrapper > li.draggable").draggable({
greedy: true,
handle: '.chat-button',
containment: 'html'
});
containment: [0, 50, 0, $(window).height() - 35]
. – Pyrometallurgy