function focusRotate(e, t) { var i = e < 0 ? itemLength + e : e, n = i - 1 < 0 ? itemLength - 1 : i - 1, o = i + 1 >= itemLength ? 0 : i + 1; t ? rotateItem.find("p").hide().end().css({ background: "none", left: "400px", top: "72px", padding: 0, width: "700px", height: "395px", opacity: .2, "z-index": 0 }).eq(i).css({ left: "-145px" }).animate({ top: 0, left: 120, "z-index": 3, opacity: 1, padding: "0 120px", width: "940px", height: "530px", "background-position": 0 }, { duration: durTime, easing: "linear" }, useTime).find("img").hover(function() { $(this).css({ transform: "scale(1.1)", transition: "all 0.5s" }) }, function() { $(this).css({ transform: "scale(1)", transition: "all 0.5s" }) }).end().find("p").show().end().end().eq(n).animate({ left: 120, "z-index": 2, opacity: .5 }, { duration: durTime, easing: "linear" }, useTime).end().eq(o).css({ left: 0, top: 0, width: "940px", height: "530px", "padding-left": "230px" }).animate({ top: "72px", left: "580px", "z-index": 1, opacity: .5, width: "700px", height: "395px", "padding-left": 0 }, { duration: durTime, easing: "linear" }, useTime) : rotateItem.find("p").hide().end().css({ background: "none", left: "400px", top: "72px", padding: 0, width: "700px", height: "395px", opacity: .2, "z-index": 0 }).eq(n).css({ top: 0, left: 120, width: "700px", height: "435px", "z-index": 3, padding: "0 120px" }).animate({ "z-index": 1, top: "72px", left: 120, opacity: .5, padding: 0, width: "700px", height: "395px" }, { duration: durTime, easing: "linear" }, useTime).end().eq(i).css({ left: 0, "padding-left": "580px", "z-index": 2 }).animate({ "z-index": 3, top: 0, left: 120, opacity: 1, padding: "0 120px", width: "940px", height: "530px" }, { duration: durTime, easing: "linear" }, useTime).find("img").hover(function() { $(this).css({ transform: "scale(1.1)", transition: "all 0.5s" }) }, function() { $(this).css({ transform: "scale(1)", transition: "all 0.5s" }) }).end().find("p").show().end().end().eq(o).animate({ "z-index": 2, left: "580px", opacity: .5 }, { duration: durTime, easing: "linear" }, useTime), pagenation.removeClass("curr").eq(i).addClass("curr") } var focusObj = $("#jyb_index_focus"), focusBox = $(".jyb_index_focusImg"), rotateItem = $(".rotate-item"), itemLength = rotateItem.size(), pagenation = $(".focus-pagenation").find("dd"), rotateBtnPr = $(".focus-arrow-left"), rotateBtnNx = $(".focus-arrow-right"), useTime = 5000, durTime = 600; rotateItem.last().css("opacity", "0.5"), $(".active").find("img").hover(function() { $(this).css({ transform: "scale(1.1)", transition: "all 0.5s" }) }, function() { $(this).css({ transform: "scale(1)", transition: "all 0.5s" }) }); var activeIndex = 0, focusTime = setInterval("focusRotate(++activeIndex%itemLength)", useTime); focusObj.mouseenter(function() { focusTime && clearInterval(focusTime), rotateBtnPr.animate({ left: 0, opacity: 1 }, 500), rotateBtnNx.animate({ right: 0, opacity: 1 }, 500) }).mouseleave(function() { focusTime && clearInterval(focusTime), focusTime = setInterval("focusRotate(++activeIndex%itemLength)", useTime), rotateBtnPr.animate({ left: "-60px", opacity: 0 }, 500), rotateBtnNx.animate({ right: "-60px", opacity: 0 }, 500) }), pagenation.click(function() { focusTime && clearInterval(focusTime); var e = $(this).index(); focusRotate(e % itemLength, !(e > activeIndex)), activeIndex = e }), rotateBtnPr.stop().click(function() { focusTime && clearInterval(focusTime), focusRotate(--activeIndex % itemLength, !0) }), rotateBtnNx.stop().click(function() { focusTime && clearInterval(focusTime), focusRotate(++activeIndex % itemLength) });