Bootstarp Learning (21) Importing JavaScript plugins

Source: Internet
Author: User
Tags jquery library

Bootstrap in addition to rich Web components, such as the drop-down menus, button groups, navigation, paging, and so on, as described earlier. He also includes some JavaScript plugins.

The bootstrap JavaScript plugin can be imported into the page individually or once in a page. Because JavaScript plugins in Bootstrap are all dependent on the jquery library, you must first import the jquery library before importing it in a single import.

Disposable Import:

Bootstrap provides a single file that contains all JavaScript plugins for Bootstrap, i.e. bootstrap.js (compressed version: Bootstrap.min.js).

Use the following (or see the right-hand Code Editor 28-29 line):

<!-Import the jquery repository because Bootstrap's JavaScript plugin relies on jquery--><script src= "http://libs.baidu.com/jquery/1.9.0/ Jquery.js "></script><!—-one-time import of all bootstrap JavaScript plugins (compressed version)--<script src=" js/ Bootstrap.min.js "></script>

Special statement: The jquery repository can also load your local jquery version.

Import separately:

To facilitate the individual import of effects files, the Bootstrap V3.2 provides 12 JavaScript plugins, respectively:

animation Transition (transitions): corresponding plug-in file "Transition.js"

modal pop-up window (Modal): corresponding plugin file "Modal.js"

Drop-down menu (Dropdown): corresponding plug-in file "Dropdown.js"

scroll Detection (scrollspy): The corresponding plug-in file "Scrollspy.js"

? Tab: the corresponding plug-in file "Tab.js"

? Prompt box (tooltips): corresponding plug-in file "Tooltop.js"

popup Box (Popover): corresponding plug-in file "Popover.js"

warning Box (alert): the corresponding plug-in file "Alert.js"

button (Buttons): corresponding plug-in file "Button.js"

Folding/accordion (Collapse): corresponding plug-in file "Collapse.js"

Photo Carousel Carousel: corresponding plugin file "Carousel.js"

Automatic positioning Buoy affix: corresponding plug-in file "Affix.js"

download of the individual plugins above can be downloaded to GitHub (https://github.com/twbs/bootstrap).

After downloading, you can view the JS folder, such as:

Next, we will introduce how these plug-ins are used, as for the plug-in source analysis, in this series do not do too much elaboration, the specific source code can read the plug-ins.

Note: in the following example, we use the one -time import method for convenience, that is, the introduction of "Bootstrap.min.js" file (the small partners can choose whether to import separately or once in their own project)

Bootstarp Learning (21) Importing JavaScript plugins

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.