我正在研究JointJS API。但是,我想防止这些元素从其原始位置移动。您能否向我建议JointJS的某些功能或CSS的任何一般功能,这些功能可以使我的对象不动。
我不能在纸上或纸上使用Interactive:false选项。$ 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;
}
Run Code Online (Sandbox Code Playgroud) 我想在JointJS Diagrams中禁用元素和链接的移动,同时保持其他特征,如元素的超链接和鼠标上的链接突出显示:悬停.我提到了以下链接:https ://groups.google.com/forum/#! searchin/jointjs/ drag/jointjs/ R0KZwKqfRbI / rGLJz3t4Un0J https://groups.google.com/forum/#!searchin/jointjs/阅读 $ 20only/jointjs/o8CKU6N7EOI/1KGNFCQQHGUJ
但他们没有帮助我.我试过了:纸.$ el.css('pointer-events','none'); 但它禁用了一切.我想只禁用元素和链接拖动
我正在研究JointJS.我有各种带文字的元素.但是元素的宽度随着文本的增加而增加.我想动态设置元素的大小,使得盒子可以达到最大高度和宽度,并通过文本换行相应地扩展.如果文本os无法放入最大高度和宽度元素,则可以动态减少fontsize.
我试过style="word-wrap: break-word;"在我的div id中使用.但是没有效果.
<div id="myholder" style="word-wrap: break-word;"> </div>
Run Code Online (Sandbox Code Playgroud)
我的持有人在JS文件中定义如下:
var paper = new joint.dia.Paper({
el: $('#myholder'),
width: 1200,
height: 700,
model: graph
});
我可以遵循什么策略?