您的位置:首页 > Web前端 > JavaScript

js跑马灯效果

2015-08-28 21:46 537 查看
function nextPage() {

/*
克隆第一张图片并添加到box后
box前移一张图片的距离动画
动画回调里把box的left值设为0 删除第一张图片
*/
$(".mypng li:first-child").clone().appendTo($(".mypng"));
$(".mypng").animate({ left: -width }, { duration: 500, easing: "easeInQuad", complete: function () {
$(this).css("left", "0");
$(".mypng li:first-child").remove();
}
});
}

function prePage() {
$(".mypng li:last-child").clone().prependTo($(".mypng"));
$(".mypng").css("left", -width);
$(".mypng").animate({ left: 0 }, { duration: 500, easing: "easeInQuad", complete: function () {

$(".mypng li:last-child").remove();
}
});
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: