jquery to achieve a simple autoplay slide effect _jquery

Source: Internet
Author: User

The example of this article tells the jquery implementation of a simple automatic playback slide effect. Share to everyone for your reference. The implementation methods are as follows:

HTML section:

<div id= "Slideshow" >
  <div>
   
  </div>
  <div>
   
  </div>
  <div>
   Pretty cool eh? This slide are proof the content can be anything.
  </div>
</div>

CSS section:

/* Slides need to be absolutely positioned within the wrapper.
This has a tiny bit of extra pizazz: */
#slideshow {
  margin:50px auto;
  position:relative;
  width:240px;
  height:240px;
  padding:10px;
  box-shadow:0 0 20px Rgba (0,0,0,0.4);
}
#slideshow > div {
  position:absolute;
  top:10px;
  left:10px;
  right:10px;
  bottom:10px;
}

jquery section:

Run after the DOM is ready.
$ ("#slideshow > Div:gt (0)"). Hide ();
SetInterval (function () {
 $ (' #slideshow > Div:first ')
  . fadeout (1000).
  Next ()
  fadeIn (1000)
  . End ()
  . Appendto (' #slideshow ');
}, 3000;

I hope this article will help you with your jquery programming.

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.