我正在开发JointJS API。然而,我希望防止元素从其原始位置上移动。您能否建议我使用JointJS的某些功能或通常的CSS中的任何功能,以使我的对象静止不动。
我不能在纸张上使用"interactive: false"选项或"paper.$el.css('pointer-events', 'none');",因为当鼠标悬停在元素上时,我需要有突出显示功能。
请建议一种禁止元素移动但允许其他功能的方法。相关的CSS代码片段如下:
我不能在纸张上使用"interactive: false"选项或"paper.$el.css('pointer-events', 'none');",因为当鼠标悬停在元素上时,我需要有突出显示功能。
请建议一种禁止元素移动但允许其他功能的方法。相关的CSS代码片段如下:
.viewport {
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
.element {
/* Give the user a hint that he can drag&drop the element. */
cursor: crosshair;
position: fixed;
}
.element * {
/* The default behavior when scaling an element is not to scale the stroke in order to prevent the ugly effect of stroke with different proportions. */
vector-effect: non-scaling-stroke;
-moz-user-select: none;
user-drag: none;
position: fixed;
}