mirror of
https://github.com/twbs/bootstrap.git
synced 2025-09-26 05:19:15 +02:00
add noConflict functionality to all bootstrap plugins
This commit is contained in:
@@ -134,6 +134,14 @@ $("#myModal").modal('show') // initializes and invokes show immed
|
||||
</pre>
|
||||
<p>Each plugin also exposes its raw constructor on a `Constructor` property: <code>$.fn.popover.Constructor</code>. If you'd like to get a particular plugin instance, retrieve it directly from an element: <code>$('[rel=popover]').data('popover')</code>.</p>
|
||||
|
||||
<h3>No Conflict</h3>
|
||||
<p>Sometimes it's neccessary to use bootstrap plugins with other ui frameworks. In these circumstances, occasionally namespace collisions can occur. If this happens, you may call <code>.noCoflict</code> on the plugin you wish to revert the value of.</p>
|
||||
|
||||
<pre class="prettyprint linenums">
|
||||
var bootstrapButton = $.fn.button.noConflict() // return $.fn.button to previously assigned value
|
||||
$.fn.bootstrapBtn = bootstrapButton // give $().bootstrapBtn the bootstrap functionality
|
||||
</pre>
|
||||
|
||||
<h3>Events</h3>
|
||||
<p>Bootstrap provides custom events for most plugin's unique actions. Generally, these come in an infinitive and past participle form - where the infinitive (ex. <code>show</code>) is triggered at the start of an event, and its past participle form (ex. <code>shown</code>) is trigger on the completion of an action.</p>
|
||||
<p>All infinitive events provide preventDefault functionality. This provides the ability to stop the execution of an action before it starts.</p>
|
||||
|
Reference in New Issue
Block a user