Search code examples
javascriptjquerydraggable

Disable automatic height from jQuery draggable


I have a Div with some prestyle that includes height: 100%

If I add jQuery draggable to the div, and moves it around it sets a fixed height on the div.

How can I disable the fixed height so it still works with the height from my stylesheet?

$('.DTable').draggable({
    heightStyle: '100%'
}).draggable({
    containment: "window",
});

Solution

  • use a parent element in your css

     .parent .DTable {height:100px;} 
    

    or use the !important on the hight

     .DTable {height:100px!important;}