1
只需调用.trigger(“mousedown”);不起作用。如何在jQuery UI中以编程方式触发可拖动?
scrollPane_Y.draggable({
axis: "y",
stop: function (event, ui) {
/*
i get triggered when the containment is hit
so if a user hits the containment and then
goes in the other direction nothing happens.
*/
scrollPane_Y.trigger("mousedown"); // doesnt work
scrollPane_Y.mousedown(function (e) { // from third link. doesnt work
scrollPane_Y.trigger(e);
});
},
containment: [0, min_scrollPane_Y, 0, max_scrollPane_Y]
});
你能更清楚吗?拖动元素命中容器时是否要停止用户操作? – sdespont
只是写我自己的。 – user1764195