Simple Carousel Diagram Widget

Source: Internet
Author: User

1 (function  () {  2     function  () {  3         var Allpar = Array.prototype.slice.call (arguments); // get passed the parameters, break up the number of groups, such as have doubts about this can refer to my collection of "elegant Code" in the understanding of the use of JavaScript, call, bind the article, the author said the old good
4         varElem = allpar[0];5         varAllimg = allpar[1];6         if(Allimg.length > 0) {7$.each (Allimg,function(i,v) {8$ (elem). Append ("//add pictures to the specified container, first hide all the carousel pictures9             })Ten             varIMGs = $ (elem). FIND ("img"); One             varMoveimg = SetInterval (function() {//repeated execution of an infinite number of times, unless Clearinterval (moveimg); A                 varTindex = $ (elem). Find (". Sthis");//Display the unique label of the picture -                 if(Tindex.length > 0) { -                     if($ (Tindex.next ()). length>0) { the$ (Tindex.next ()). Show (). addclass ("Sthis"); -$ (Tindex.next ()). Siblings (). Hide (). Removeclass ("Sthis"); -}Else { -$ (imgs[0]). Show (). addclass ("Sthis"); +$ (imgs[0]). Siblings (). Hide (). Removeclass ("Sthis"); -                     }  +}Else { A$ (imgs[0]). Show (). addclass ("Sthis"); at                 } -}, 1000) -         } -     } -}) (JQuery)

1 <Script>2         vararr= ["image/sf2-bg.jpg","Image/top_logo.png","Image/ken.png","Image/ken-tatsumaki-senpuu-kyaku.png"]3         $(function () {4             $("#login"). Click (function(){5                 $( This). Moreimg ($ ("#cll"), arr);//call the function in the widget you wrote6             })7             8         })9     </Script>
Ten <div id= "CLL" > click </div>

Simple Carousel Diagram Widget

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.