简体   繁体   English

jQuery UI 可拖入可排序

[英]jQuery UI draggable into sortable

When I'm dragging an element from a draggable into a sortable, how do I change the amount of space the sortable elements drop down to make room for the draggable element to be dropped there?当我将一个元素从可拖动元素拖动到可排序元素中时,如何更改可排序元素下拉的空间量,以便为可拖动元素留出空间? Right now, it defaults to the size of my sortable handle (16px), but I'd like to make it about 100px or so.现在,它默认为我的可排序句柄的大小(16px),但我想让它大约为 100px 左右。

Thank you!谢谢!

You can style the placeholder element by adding a custom CSS class to it:您可以通过向其添加自定义 CSS class 来设置占位符元素的样式:

.myPlaceHolderClass { height: 100px !important; }

$('#sortable').sortable('option', 'placeholder', 'myPlaceHolderClass');

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM