1

只需调用 .trigger("mousedown"); 不起作用。

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]
});
4

1 回答 1

0

您可以使用正确的参数直接调用其私有方法。

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.
        */

         // retrieve the instance and call its private method
         scrollPane_Y.data("ui-draggable")._mouseDown(event);
    },
    containment: [0, min_scrollPane_Y, 0, max_scrollPane_Y]
});
于 2013-02-25T03:33:12.820 回答