jquery2014-08-03 06:46:24 4774
5种超酷的Jquery轮换特效融为一体。
"); ImgRotation.Parent.append(ImgRotation.Mainchild); tips = $(""); tips.css("color", "#fff").css("padding-left", "10px").css("padding-top", "10px"); tips.css("width", ImgRotation.Parameters[0].width "px").css("height", "45px").css("background-color", "#333").css("opacity", "0.8").css("margin-top", ImgRotation.Parameters[0].height "px"); ImgRotation.Mainchild.append(tips); ImgRotation.Mainchild.hover(function() { tips.animate({ marginTop: ImgRotation.Parameters[0].height - 45 "px" }, 500) }, function() { tips.animate({ marginTop: ImgRotation.Parameters[0].height "px" }, 500) }); ImgRotation.Animate(); }, Clear: function() { $(".item").remove(); }, Animate: function() { switch(ImgRotation.index){ case 0: ImgRotation.RoationA(); break; case 1: ImgRotation.RoationB(); break; case 2: ImgRotation.RoationC(); break; case 3: ImgRotation.RoationD(); break; case 4: ImgRotation.RoationE(); break; } ImgRotation.index ; }, RoationA: function() { ImgRotation.index = 0; tips.html(ImgRotation.dJson[ImgRotation.index].imgTips); var bgLeft = $(""); bgLeft.css("width", ImgRotation.Parameters[0].width / 2 "px").css("height", ImgRotation.Parameters[0].height "px").css("position", "absolute").css("background-image", 'url(' ImgRotation.dJson[ImgRotation.index].imgUrl ')').css("margin-left", -ImgRotation.Parameters[0].width / 2 "px"); var bgRifht = $(""); bgRifht.css("width", ImgRotation.Parameters[0].width / 2 "px").css("height", ImgRotation.Parameters[0].height "px").css("position", "absolute").css("margin-left", ImgRotation.Parameters[0].width "px").css("background-image", 'url(' ImgRotation.dJson[ImgRotation.index].imgUrl ')').css("background-positionX", -ImgRotation.Parameters[0].width / 2 "px"); ImgRotation.Mainchild.append(bgLeft); ImgRotation.Mainchild.append(bgRifht); bgLeft.animate({ marginLeft: "0px" }, 200, function() { $(this).animate({ marginLeft: "-100px" }, 250, function() { $(this).animate({ marginLeft: "0px" }, 100, function() { $(this).animate({ marginLeft: "-50px" }, 100, function() { $(this).animate({ marginLeft: "0px" }, 50); }); }) }); }); bgRifht.animate({ marginLeft: ImgRotation.Parameters[0].width / 2 "px" }, 200, function() { var basicLeft = ImgRotation.Parameters[0].width / 2; $(this).animate({ marginLeft: basicLeft 100 "px" }, 250, function() { $(this).animate({ marginLeft: basicLeft "px" }, 100, function() { $(this).animate({ marginLeft: basicLeft 50 "px" }, 100, function() { $(this).animate({ marginLeft: basicLeft "px" }, 50); }); }); }); }); }, RoationB: function() { ImgRotation.Clear(); ImgRotation.index = 1; tips.html(ImgRotation.dJson[ImgRotation.index].imgTips); for (var i = 0; i "); $(mImgC).css({ "width": mWidth "px", "height": ImgRotation.Parameters[0].height "px", "background-image": 'url(' ImgRotation.dJson[ImgRotation.index].imgUrl ')', "background-positionX": -mWidth * i "px", "position": "absolute", "margin-left": mWidth * i "px", "margin-top": -ImgRotation.Parameters[0].height "px" }); ImgRotation.Mainchild.append(mImgC); mImgC.animate({ marginTop: "0px" }, 300 i * 100); } }, RoationC: function() { ImgRotation.Clear(); ImgRotation.index = 2; tips.html(ImgRotation.dJson[ImgRotation.index].imgTips); for (var i = 0; i "); $(mImgC).css({ "width": ImgRotation.Parameters[0].width "px", "height": mHeight "px", "background-image": 'url(' ImgRotation.dJson[ImgRotation.index].imgUrl ')', "background-positionY": -mHeight * i "px", "position": "absolute", "margin-top": mHeight * i "px", "margin-left": -ImgRotation.Parameters[0].width "px" }); ImgRotation.Mainchild.append(mImgC); mImgC.animate({ marginLeft: "0px" }, 300 i * 100); } }, RoationD: function() { ImgRotation.Clear(); ImgRotation.index = 3; tips.html(ImgRotation.dJson[ImgRotation.index].imgTips); mWidth = ImgRotation.Parameters[0].width / 4; mHeight = ImgRotation.Parameters[0].height / 3; for (var i = 0; i "); $(mImgC).css({ "width":"0px", "height":"0px", "position": "absolute", "background-image": 'url(' ImgRotation.dJson[ImgRotation.index].imgUrl ')' }); ImgRotation.Mainchild.append(mImgC); if (i >= 0 && i 3&&i"); $(mImgC).css({ "width":mWidth "px", "height":mHeight "px", "opacity":"0", "position": "absolute", "background-image": 'url(' ImgRotation.dJson[ImgRotation.index].imgUrl ')' }); ImgRotation.Mainchild.append(mImgC); if (i >= 0 && i 3&&i
彭亚欧个人博客原创文章,转载请注明出处
文章关键词:Jquery精美图片轮滚特效,Jquery多种图片轮滚特效
文章固定链接:https://www.pengyaou.com/legendsz/front/codejq/NzI=.html
上一篇 CSS3 input美化
下一篇 ASP.NET文件传送