JQuery Picture scrolling Carousel Sample Code

Source: Internet
Author: User

  This article mainly introduces the implementation of jquery graphics scrolling carousel, need friends can refer to the following

The complete item in the appendix     code is as follows: <! DOCTYPE html>  <html>  <head>  <title> picture switching </title>  <script type= " Text/javascript "src=" js/jquery-1.11.0.min.js "></script>  <script type=" Text/javascript ">   var num = 0  $ (function () {  $ ("Div ol li"). MouseOver (function (e) {  $ (this). attr (' class ', ' current ' );  $ (this). Siblings (). attr ("Class", ""); Sibling node's class attribute is set to null  //alert (' ul '). Index ())   num = $ (' ul '). Index () + 2  var index = $ (this). index (); Record selected Li tags in ul index  //Picture cascading phenomenon in order to display the current picture, set the current picture's z-index value to be larger than the other sibling element   $ ("Div ul li"). EQ (index). css ({" Left ":" 650px "," ZIndex ": num})   $ (" DIV-ul li "). EQ (index). siblings (). CSS (" ZIndex ", num-1); //animation effects, pictures from right fly into   $ ("Div ul li"). EQ (index). Animate ({left: "0"},500)    });   });  </script>  & Lt;style type= "Text/css" >  *{margin:0px;padding:0px;border:0px;}   Ul,ol{list-style:none;}   All{width:650px;height:250px;margin:100px auto;position:relative;border:1px solid Crimson;overflow:hidden;}   All ul{position:relative;z-index:1;position:relative;    /* son of */ . All UL li{position:absolute;left:0;top:0px;     all ol{position:absolute;z-index:2; right:10px;bottom:10px;   All ol li{width:20px;height:20px;background: #333 border:1px solid #509629;font-weight:  bold;text-align : center;line-height:20px;float:left;margin-left:10px;margin-top:10px;}     all ol. current{width:30px;height:30px;line-height:30px;border:1px Solid red;margin-top:0px;  cur Sor:pointer;}   </style>  </head>  <body>  <div class= "All" >  <ul>  <li><img src= "src/1.jpg"/></li>  <li><img src= "Src/2.jpg"/></li>  <li><img src= "src/3.jpg"/></li>  <li><img src= "Src/4.jpg"/></li>  </ul>  <ol>  <li class= "current" >1</li>  <li>2</li>   <li>3</li>  <li>4</li>  </ol>  </div>  </body>   </html>   

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.