draggable.containment String|Element|jQuery default: ""

Defines the element in which the window will be able to move. The containment option overrides the appendTo setting and attaches the Window to the specified DOM element. Accepts either a selector or an element.

The containment element has to be positioned, that is, its CSS position attribute has to be set to relative, absolute, or fixed.


    #container {
      position: relative;
      width: 500px;
      height: 500px;
      border: 1px solid grey;

<div id="container">
    <div id="window">
        <p>Alvar Aalto is one of the greatest names in modern architecture and design.
          Glassblowers at the iittala factory still meticulously handcraft the legendary vases
          that are variations on one theme, fluid organic shapes that let the end user decide the use.

    $(document).ready(function() {
        width: "300px",
        height: "200px",
        draggable: {
            containment: "#container"
In this article