Alpha Geek
Alpha Geek

Reputation: 489

jQueryUI: restrict container height on drag and drop element

I have achieved a drag & drop functionality using the jquery UI.

Here is the js fiddle (http://jsfiddle.net/metm0v0f/) for it.

When I drop a div from one div to another div, I wanted to restrict the height to increase. I have tried to restrict with the css classes:

overflow-x: hidden;
overflow-y: hidden;

but it is still increasing the height. Can anyone please help me to make the container dimensions fixed?

Upvotes: 0

Views: 290

Answers (1)

Shaaer
Shaaer

Reputation: 557

Just add these 2 lines to the dbContainer1,dbContainer2 classes:

.dbContainer1 {
    width: 40%;
    float: left;
    border: dotted 1px red;
    /*add the following lines*/
    height:250px;
    overflow-y:scroll;
}
.dbContainer2 {
    width: 40%;
    float: left;
    border: dotted 1px green;
    /*add the following lines*/
    height:250px;
    overflow-y:scroll;
}

Upvotes: 2

Related Questions