I need to return the element .draggable-box
into the containment
option, how can i achieve this?
var windowWidth = $(window).width();
var windowHeight = $(window).height();
$(".draggable-box").draggable({
containment: [($(this).width() / 2), 50, windowWidth - 100, windowHeight - 200]
});
If I use $(this)
, window
is returned...