The fade-out-of-present carousel based on jquery

Source: Internet
Author: User

/*<div id= "Ads" > <div> <ul> <li><a href= "#" target= "_blank" ></a></li> <li><a href=" # "target=" _blank "></a></li> <li><a href=" # "target=" _blank "></a></li> </ul> <div> <div class=" Pre_left " ></div> <div class=" next_right "></div> </div> </div><ul><li class=" Focus "></li&gt            ; <li></li><li class= "Lastli" ></li></ul></div>*/;(function () {var collection = { $ads: $ ("#ads"), $adsContent: $ ("#ads >div>ul>li"),//Large AD $arrows: $ ("#ads >div>div>div") ,//Toggle Arrow $markPoints:$ ("#ads >ul>li"),//Small dot hidetime:400,//vanishing time showtime:800,//time intervaltime:4000//interval},    Len = collection. $adsContent. Length;    Collection. $ads. Hover (function () {collection. $arrows. FadeIn ("Fast"). CSS ("display", "Inline-block");    },function () {collection. $arrows. FadeOut ("fast");       });    Loop right Toggles function AutoPlay () {Turntolorr (true,false); } var _setinterval=setinterval (autoplay,collection.    IntervalTime);                Click the arrows to toggle the collection. $arrows. Each (function (index) {if (index==0) {$ (this). On ("click", Function () {            Turntolorr (false,true);        });            } else{$ (this). On ("click", Function () {Turntolorr (true,true);        }); }})//Click on small dots to toggle collection. $markPoints. Each (function (index) {$ (this). On ("click", Function () {collection. $adsC).    Ontent.stop (false,true); if (!collection. $adsContent. Is (": Animated")) {clearinterval (_setinterval);    var $target = collection. $adsContent. EQ (index);    Animate ($target, true);    Animate ($target. Siblings (), false);    Markdot (collection. $markPoints. EQ (index)); _setinterval=setinterval (function () {AutoPlay (collection. $adsContent)},collection.    IntervalTime); })})//Toggle function Turntolorr (Directionisright,clicklorr) {if (Clicklorr) collection. $adsContent. St        OP (false,true);        if (!collection. $adsContent. Is (": Animated")) {if (Clicklorr) clearinterval (_setinterval);                    Collection. $adsContent. Each (function (index) {if ("search") {animate (this), false);          if (directionisright) {if (Index+1<len) {Animate ($ (this). Next (), true);            Markdot (collection. $markPoints. EQ (index+1));            } else{animate (collection. $adsContent. EQ (0), true);            Markdot (collection. $markPoints. EQ (0));         }} else{               if (index-1>=0) {Animate ($ (this). Prev (), true);            Markdot (collection. $markPoints. EQ (index-1));            } else{animate (collection. $adsContent. EQ (len-1), true);            Markdot (collection. $markPoints. EQ (len-1)); }} if (Clicklorr) _setinterval=setinterval (autoplay,collection.        IntervalTime);        return false;        }            });    }}//is responsible for marking dot function Markdot ($target) {$target. addclass ("Focus"). Siblings (). Removeclass ("Focus");    }//is responsible for judging the current large ad function search ($target) {if ($target. CSS ("Z-index") ==1) return true;    else return false; }//is responsible for animating function animate ($target, show) {if (show) $target. CSS ("Z-index", "1"). Animate ({opacity:1,filter: "ALP Ha (opacity=100) "},collection.        SHOWTIME); else $target. Animate ({opacity:0,filter: "Alpha (opacity=0)"},collection.    Showtime,function () {$ (this). CSS ("Z-index", "1")}); }})()

  

The fade-out-of-present carousel based on jquery

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.