向左或向右滑动并从左上角滑动更多
问题描述:
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)'来实现' –