0
jQuery中有slideUp(),slideDown()和slideToggle()函數。但爲什麼不添加slideLeft(),slideRight(),slideTopLeftCorner(),slideTopRightCorner()等函數呢?有沒有辦法像我的假設那樣做。向左或向右滑動並從左上角滑動更多
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)'來實現' –