[英]Swapping fadein with slide horizontally in jquery
我将以下脚本用作动画背景,现在图片淡入和淡出,但我希望它们水平向左滑动。
我的问题是,这是标准的jQuery“功能”,因为我很难找到正确的方法来执行此操作。
有谁能够帮助我修改我的代码,使其能够执行我想要的工作?
提前致谢。
我正在使用的代码:
$(function(){
$('#background img:gt(0)').hide();
setInterval(function(){
$('#background :first-child').fadeOut()
.next('img').fadeIn()
.end().appendTo('#background');},
3000);
});
您可以使用JQuery .animate()
进行水平切换。 例如:
$('#background :first-child').animate({width: 'toggle'})
.next('img').animate({width: 'toggle'})
.end().appendTo('#background');},
3000);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.