Skip to content
Related Articles
Open in App
Not now

Related Articles

jQuery UI Resizable containment Option

Improve Article
Save Article
  • Last Updated : 03 Mar, 2021
Improve Article
Save Article

jQuery UI consists of GUI widgets, visual effects, and themes implemented using jQuery, CSS, and HTML. jQuery UI is great for building UI interfaces for the webpages. The jQuery UI Resizable containment option is used for resizing the element within the given boundary element.


    containment: "parent"

CDN Links: First, add jQuery UI scripts needed for your project.

<link rel=”stylesheet” href=”//”>
<script src=”//”></script>
<script src=”//”></script>



<!doctype html>
<html lang="en">
    <meta charset="utf-8">
    <link rel="stylesheet" 
    <script src=
    <script src=
        h1 {
            color: green;
        #box {
            width: 500px;
            height: 250px;
            border: 2px solid orange;
            float: left
        #first_div {
            width: 150px;
            height: 150px;
            background: green;
            display: flex;
            justify-content: center;
            align-items: center;
            text-align: center;
    <h3>jQuery UI Resizable containment Option</h3>
    <div id="box">
        <div id="first_div">Div content</div>
        $(function () {
                containment: "#box",


Resizable containment option


My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!