I'm dealing with an element that I want to make draggable only along the Y-axis. It needs to be able to go past the top of the screen, but I need to restrict it from going past the bottom of the screen. I recently came across the containment feature in the jQuery Draggable API, but couldn't find a solution that addresses my specific scenario. Here's the current code snippet I have:
JavaScript:
$(document).ready(function() {
$("#elem").draggable({
axis: "y"
});
});