我扩展了名为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
函数从左侧开始显示图像,并向右侧前进.I am looking for some way to do the same thing but start from the right side and progress toward the left.谢谢!
EDIT
jQuery Interface has something like I need (I basically need their "slide in right" and "slide out left" functions), but I couldn't get this to work with jQuery 1.3: http://interface.eyecon.ro/demos/ifx.html . Also, their demo seems to broken as well as it will only do a slide once before throwing a million errors.