0

我有 jQuery UI 可拖动工作,并且 ghost 设置为 true,当我调整元素大小时会出现一个透明的 ghost。

$('.container').resizable({
    ghost: true
});

我想删除背景颜色,设置不透明度并设置重影边框的样式。

.ui-resizable-ghost {
    z-index: 9999;
    border: 1px dashed blue !important;
    background-color: none !important;
}

不过,即使我使用 !important,似乎也只有 z-index 和边框属性生效。

4

1 回答 1

3

看起来非常可行,无需修改源代码。定位.ui-resizable-helper选择器:

jsFiddle 示例

.ui-resizable-helper {
    border: 4px dashed #faa;
    background-color: #eeeecc;
    opacity: .5;
}

要使助手/幽灵的背景透明,请添加:

.ui-resizable-ghost {
     opacity:0 !important;
}
于 2013-10-29T20:00:48.477 回答