最佳答案
我扩展了称为 slideRightShow()
和 slideLeftHide()
的 jQuery
效果,使用了一对与 slideUp()
和 slideDown()
类似的函数,如下所示。然而,我也想实现 slideLeftShow()
和 slideRightHide()
。
我知道有大量的库提供这种类型的东西(我想避免添加另一个大的 javascript
文件集) ,但是谁能提供一个简单的例子来说明如何实现 slideLeftShow()
或 slideRightHide()
?
jQuery.fn.extend({
slideRightShow: function() {
return this.each(function() {
jQuery(this).animate({width: 'show'});
});
},
slideLeftHide: function() {
return this.each(function() {
jQuery(this).animate({width: 'hide'});
});
},
slideRightHide: function() {
return this.each(function() {
???
});
},
slideLeftShow: function() {
return this.each(function() {
???
});
}
});
上面的 slideRightShow
函数从左边开始显示图像,然后向右边移动。我正在寻找一些方法来做同样的事情,但从右边开始,向左边进展.谢谢!
剪辑
JQuery Interface 有一些类似我需要的东西(我基本上需要它们的“向右滑入”和“向左滑出”功能) ,但是我无法让它与 jQuery 1.3: http://interface.eyecon.ro/demos/ifx.html一起工作。此外,他们的演示似乎打破了,以及它只会做一个幻灯片之前抛出一百万个错误。