私はInteract.jsを検出しましたが、それを有効にできましたが、ドラッグ(慣性を有効にした状態)もう動作しません。カーソル:ポインタはまだ動作します。解決策を考えることができる人は誰ですか?css:hoverでドラッグトランスフォームを行った後のInteract.jsがもう機能しません
CSS:
.bubble:hover {
transform: scale(1.1);
cursor: pointer;
}
JS:ここ
interact('.bubble').draggable({
inertia: {
resistance: 15,
minSpeed: 100,
endSpeed: 50
},
onmove: function(e) {
var target = e.target,
// keep the dragged position in the data-x/data-y attributes
x = (parseFloat(target.getAttribute('data-x')) || 0) + e.dx,
y = (parseFloat(target.getAttribute('data-y')) || 0) + e.dy;
// translate the element
target.style.webkitTransform =
target.style.transform =
'translate(' + x + 'px, ' + y + 'px)';
// update the posiion attributes
target.setAttribute('data-x', x);
target.setAttribute('data-y', y);
}
}).on('tap', function(e) {
console.log('tapped');
e.preventDefault();
});
チェックフィドル:事前にhttps://jsfiddle.net/82utnzbx
ありがとう!あなたが原因interact.js
に、すなわちbubble
に適用されている複数の変換のため、これが起こっている
デモまたはフィドルを作成します。 – nashcheez
@nashcheez https://jsfiddle.net/82utnzbx/ – JC97