Draggable elements can be constrained to the 'window' by setting the attribute constrain-selector="window", or using javascript by using node.plugin(ITSA.Plugins.NodeConstrain). The plugin does nothing more than add the right attribute to the draggable Element, and it just works.
Drag the 2 rectangles: they will be constrained inside the window. The first is constrained using html, the second is set up using javascript.
Code-example:
<body>
<div class="container" plugin-dd="true" plugin-constrain="true" constrain-selector="window"></div>
<div id="without" class="container" plugin-dd="true"></div>
</body>
<script src="itsabuild-min.js"></script>
<script>
document.getElement('#without').plug('constrain');
</script>