禁用 jQuery 可拖动的自动高度
Disable automatic height from jQuery draggable
我有一个 Div 带有一些预样式,其中包括 height: 100%
如果我将 jQuery 可拖动添加到 div,并在其周围移动它,则会在 div 上设置固定高度。
如何禁用固定高度,以便它仍然适用于我的样式表中的高度?
$('.DTable').draggable({
heightStyle: '100%'
}).draggable({
containment: "window",
});
在您的 css
中使用父元素
.parent .DTable {height:100px;}
或者在最上面使用 !important
.DTable {height:100px!important;}
我有一个 Div 带有一些预样式,其中包括 height: 100%
如果我将 jQuery 可拖动添加到 div,并在其周围移动它,则会在 div 上设置固定高度。
如何禁用固定高度,以便它仍然适用于我的样式表中的高度?
$('.DTable').draggable({
heightStyle: '100%'
}).draggable({
containment: "window",
});
在您的 css
中使用父元素 .parent .DTable {height:100px;}
或者在最上面使用 !important
.DTable {height:100px!important;}