Jquery 向左或向右滑动,然后从左上角滑动,等等

Jquery 向左或向右滑动,然后从左上角滑动,等等,jquery,Jquery,jQuery中有slideUp()、slideDown()和slideToggle()函数。但是为什么不添加slideLeft()、slideRight()、slideTopLeftCorner()、slideTopRightCorner()等函数呢?还有什么可以像我的假设那样去做的吗 你可以这样使用: $(this).hide("slide", { direction: "left" }, 1000); $(this).show("slide", { direction: "left" },

jQuery中有slideUp()、slideDown()和slideToggle()函数。但是为什么不添加slideLeft()、slideRight()、slideTopLeftCorner()、slideTopRightCorner()等函数呢?还有什么可以像我的假设那样去做的吗

你可以这样使用:

$(this).hide("slide", { direction: "left" }, 1000);
$(this).show("slide", { direction: "left" }, 1000);

从右下角到左上角,尝试这样做。 另一种方式-您可以在函数中更改选项marginLeft和marginTop

jQuery.fn.blindLeftTopOut = function (duration, easing, complete) {
    return this.animate({
        marginLeft: -this.outerWidth(),
        marginTop:  -this.outerHeight()
    }, jQuery.speed(duration, easing, complete));
};
$(element).blindLeftTopOut();

slideTopRightCorner()@c-link如何,这取决于您的CSS,但通常通过默认的
.hide(800)