<script type= "Text/javascript" src= "/effect/images/20127/141615/jquery-1.6.2.min.js" ></script> <script type= "Text/javascript" > $ (function () { var len = $ (". Focus ul Li"). length; var width = 600; Overall width, based on this calculation offset var indent = 50; A short length of time to go back when the title is hidden var index = 0; var Pictimer; var btn = "<div class= ' btn ' >"; for (var i = 0; i < len; i++) { BTN = "<span></span>"; } BTN = "</div>"; $ (". Focus"). Append (BTN); $ (". Focus. BTN span"). MouseEnter (function () { Index = $ ('. focus. BTN span '). Index ($ (this)); Play (index); ). EQ (0). Trigger ("MouseEnter"); $ (". Focus"). Hover (function () { Clearinterval (Pictimer); },function () { Pictimer = setinterval (function () { index++; if (index = = len) {index = 0;} Play (index); },5000); }). Trigger ("MouseLeave"); Function Play (index) { var $now = $ (". Focus ul Li.on"); if ($now. length > 0) { $now. Find ("H5"). Stop (True,true). Animate ({left: "-" + (width-indent) + "px"},400,function () { $ (this). Animate ({left: "-" + (2*width) + "px"},400); }); $now. Find ("A.button"). Stop (True,true). Fadeto (400,0); var hidedelay = settimeout (function () { $now. Find ("P"). Stop (True,true). Animate ({left:-"+ (width-indent) +" px "},400,function () { $ (this). Animate ({left: "-" + (2*width) + "px"},400); $now. Find ("Div.imgbox"). Stop (True,true). Animate ({left: "-" + (2*width) + "px"},400); }); },200); var Showdelaya = settimeout (function () { Show (index); },700); } else { Show (index); } } Function Show (index) { var $next = $ (". Focus ul Li")-eq (index); $next. Find ("H5"). CSS ({left: "0px"}); $next. Find ("P"). CSS ({left: "0px"}); $next. Find ("A.button"). CSS ({left: "0px"}); $next. Find ("Div.imgbox"). CSS ({left: "0px"}); $next. Find ("H5"). Stop (True,true). Animate ({left: "-" + width + "px"},400); var Showdelayb = settimeout (function () { $next. Find ("Div.imgbox"). Stop (True,true). Animate ({left: "-" + width + "px"},300); $next. Find ("P"). Stop (True,true). Animate ({left: "-" + width + "px"},300,function ()) { $next. Find ("A.button"). Stop (True,true). Animate ({left: "-" + width + "px"},300,function () {$ (this). Fadeto (400,1);}); }); },300); $ (". Focus. BTN span"). Removeclass (' on '). EQ (index). addclass ("on"); $ (". Focus ul Li"). Removeclass (' on '). EQ (index). addclass ("on"); } }); </script> |