【发布时间】:2015-01-16 10:25:59
【问题描述】:
我在使用 jQuery Ui 可拖动元素时遇到了样式问题。 这就是我所拥有的
如您所见,我有两个可放置区域,每个区域中的元素都是可拖动的,并且可以将元素从一个块拖放到另一个块 这里唯一的问题是,当我将元素从顶部块拖动到块下时,拖动的元素会被放置在可放置的元素之下,但是当我从底部拖动到顶部时,就没有这样的问题了。
这里是拖拽代码
$(".slide").draggable({
// brings the item back to its place when dragging is over
revert:true,
// once the dragging starts, we decrease the opactiy of other items
// Appending a class as we do that with CSS
start: function(event, ui) { $(this).css("z-index", a++); },
drag:function () {
$(this).removeClass('droped');
},
// adding the CSS classes once dragging is over.
stop:function () {
$(this).addClass('droped');
},
zIndex: 10000,
snapMode: "inner"
});
谁能帮帮我,我已经做了2天了,不知道是什么问题,我试图改变每个块的z-index位置,但没有结果;
【问题讨论】:
-
您的小提琴不工作,但您可以尝试为您要移动的块提供 z-index,也可能为您想要的下面的块提供 z-index
-
从
ul.book_listfiddle中删除z-index:2 -
请不要绕过质量过滤器。这不是您的第一个问题,you have included code directly in the question before。
标签: javascript jquery html css jquery-ui