Multi-button "load in" effect experience with the BOOTSTRAP3 and Ladda UI implementations

Source: Internet
Author: User
Keywords button

Intermediary transaction http://www.aliyun.com/zixun/aggregation/6858.html ">seo diagnose Taobao guest cloud host technology Hall

  

Online Demo

In developing web-based Web sites or Web applications, often in the process of Ajax calls need to prompt the user and show the relevant "load" effect, similar UI design is also very much, for example, when clicked a button, next to it display a "load" text, or add a "spin gif "Animation effect chart.

In today's tutorial, we'll introduce a Ladda UI conceptual design that will help you design different button-based loading effects and integrate them into the BOOTSTRAP3 framework, as follows:

  

It can easily help you through the button to prompt the user related "loading" status, and support different load effects, configuration is also very simple, only to the corresponding button to add Data-style properties, as follows:

Data-style= "Slide-down"

In the next tutorial, we'll explain how to integrate Ladda UI design and BOOTSTRAP3 to provide a complete "load" effect experience.

Related class libraries

First import the related bootstrap and Ladda class libraries:

Here we also import the Jdribbble plug-in to achieve AJAX-related effects (of course, as data is available, you can use any other service, or your own Ajax) to get the best design pictures from dribbble.com.

If you don't need to show progress, basically you just need to add the following code to the AJAX related request to complete the JavaScript code development:

var l =ladda.create (this);

L.start ();

When the AJAX request completes, you can invoke the following stop:

L.stop ();

That is, complete the whole "loading" process, which contains the "disabled" the current button operation, very convenient, improve the development efficiency.

Of course, if you need to prompt the user the current progress, it built a progress bar, you can use the following code to set the current progress:

L.setprogress (0.1);

Javacript is finished writing, you need to define the loading effect in HTML, as follows:

More design

Here we define the use of

Data-style= "Slide-down"

To set the required load effect, this effect is to set a slide down the effect of switching, more effect, please visit: http://lab.hakim.se/ladda/

Related CSS

Here we refer to the relevant CSS to ensure that Ladda can work properly with BOOTSTRAP3.

Related Article

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.