Based on jQuery click to load Animation button special effects, jquery Special Effects

Source: Internet
Author: User

Based on jQuery click to load Animation button special effects, jquery Special Effects

Share a special effect based on jQuery click to load the Animation button. This is an animation special effect code based on jQuery + CSS3. As follows:

Download Online Preview source code

Implementation code.

Html code:

<div class="container">       <div class="row">           <div class="col-md-6 col-md-offset-3 text-center">               <p>                   <button class="btn btn-primary ladda-button" data-style="expand-left"><span class="ladda-label">expand-left</span></button>                   <button class="btn btn-primary ladda-button" data-style="expand-right"><span class="ladda-label">expand-right</span></button>                   <button class="btn btn-primary ladda-button" data-style="expand-up"><span class="ladda-label">expand-up</span></button>                   <button class="btn btn-primary ladda-button" data-style="expand-down"><span class="ladda-label">expand-down</span></button>               </p>           </div>       </div>       <div class="row">           <div class="col-md-6 col-md-offset-3 text-center">               <p>                   <button class="btn btn-info ladda-button" data-style="zoom-in"><span class="ladda-label">zoom-in</span></button>                   <button class="btn btn-info ladda-button" data-style="zoom-out"><span class="ladda-label">zoom-out</span></button>               </p>           </div>       </div>       <div class="row">           <div class="col-md-6 col-md-offset-3 text-center">               <p>                   <button class="btn btn-warning ladda-button" data-style="slide-left"><span class="ladda-label">slide-left</span></button>                   <button class="btn btn-warning ladda-button" data-style="slide-right"><span class="ladda-label">slide-right</span></button>                   <button class="btn btn-warning ladda-button" data-style="slide-up"><span class="ladda-label">slide-up</span></button>                   <button class="btn btn-warning ladda-button" data-style="slide-down"><span class="ladda-label">slide-down</span></button>               </p>               <p><button class="btn btn-warning ladda-button" data-style="contract"><span class="ladda-label">contract</span></button></p>           </div>       </div>       <div class="row">           <div class="col-md-6 col-md-offset-3 text-center progress-demo">               <p>Built-in progress bar</p>               <p>                   <button class="btn btn-danger ladda-button" data-style="expand-right"><span class="ladda-label">expand-right</span></button>                   <button class="btn btn-danger ladda-button" data-style="expand-left"><span class="ladda-label">expand-left</span></button>                    <button class="btn btn-danger ladda-button" data-style="contract"><span class="ladda-label">contract</span></button>               </p>           </div>       </div>       <div class="row">           <div class="col-md-6 col-md-offset-3 text-center">               <p>Sizes</p>               <p>                   <button class="btn btn-primary btn-xs ladda-button" data-style="expand-right" data-size="xs"><span class="ladda-label">extra small</span></button>                   <button class="btn btn-primary btn-sm ladda-button" data-style="expand-right" data-size="s"><span class="ladda-label">small</span></button>                    <button class="btn btn-primary btn-lg ladda-button" data-style="expand-right" data-size="l"><span class="ladda-label">large</span></button>               </p>           </div>       </div>   </div>

Js Code:

// Bind normal buttons      Ladda.bind('div:not(.progress-demo) button', { timeout: 2000 });       // Bind progress buttons and simulate loading progress      Ladda.bind('.progress-demo button', {          callback: function (instance) {              var progress = 0;              var interval = setInterval(function () {                  progress = Math.min(progress + Math.random() * 0.1, 1);                  instance.setProgress(progress);                   if (progress === 1) {                      instance.stop();                      clearInterval(interval);                  }              }, 200);          }      });

Via: http://www.w2bc.com/article/56623

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.