Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Watch it overflow with all this extra lorem ipsum text we've included.Ĭras mattis consectetur purus sit amet fermentum. Overflowing text to show optional scrollbar This link and that link should have tooltips on hover. This button should trigger a popover on click. If (!data) return e.preventDefault() // stops modal from being shownĭuis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem. This provides the ability to stop the execution of an action before it starts. shown) is trigger on the completion of an action.Īll infinitive events provide preventDefault functionality. show) is triggered at the start of an event, and its past participle form (ex. Generally, these come in an infinitive and past participle form - where the infinitive (ex. $.fn.bootstrapBtn = bootstrapButton // give $().bootstrapBtn the bootstrap functionalityīootstrap provides custom events for most plugin's unique actions. Var bootstrapButton = $.fn.button.noConflict() // return $.fn.button to previously assigned value noConflict on the plugin you wish to revert the value of. In these circumstances, namespace collisions can occasionally occur. Sometimes it is necessary to use Bootstrap plugins with other UI frameworks. If you'd like to get a particular plugin instance, retrieve it directly from an element: $('').data('popover'). $("#myModal").modal('show') // initializes and invokes show immediatelyĮach plugin also exposes its raw constructor on a `Constructor` property: $.fn.popover.Constructor. $("#myModal").modal() // initialized with no keyboard $("#myModal").modal() // initialized with defaults $(".btn.danger").button("toggle").addClass("fat")Īll methods should accept an optional options object, a string which targets a particular method, or nothing (which initiates a plugin with default behavior):
All public APIs are single, chainable methods, and return the collection acted upon. We also believe you should be able to use all Bootstrap plugins purely through the JavaScript API.
This looks like this:Īlternatively, to target a specific plugin, just include the plugin's name as a namespace along with the data-api namespace like this: $('body').off('.alert.data-api') Programmatic API Therefore, we also provide the ability to disable the data attribute API by unbinding all events on the body namespaced with `'data-api'`. That said, in some situations it may be desirable to turn this functionality off. This is Bootstrap's first class API and should be your first consideration when using a plugin. You can use all Bootstrap plugins purely through the markup API without writing a single line of JavaScript. Both bootstrap.js and contain all plugins in a single file. Plugins can be included individually (though some have required dependencies), or all at once. JavaScript in Bootstrap Individual or compiled