diff --git a/javascript.html b/javascript.html index f0be59da8e..dcc2a1e84c 100644 --- a/javascript.html +++ b/javascript.html @@ -43,14 +43,14 @@ $(document).off('.alert.data-api')
We also believe you should be able to use all Bootstrap plugins purely through the JavaScript API. All public APIs are single, chainable methods, and return the collection acted upon.
{% highlight js %} -$(".btn.danger").button("toggle").addClass("fat") +$('.btn.danger').button('toggle').addClass('fat') {% endhighlight %}All methods should accept an optional options object, a string which targets a particular method, or nothing (which initiates a plugin with default behavior):
{% highlight js %} -$("#myModal").modal() // initialized with defaults -$("#myModal").modal({ keyboard: false }) // initialized with no keyboard -$("#myModal").modal('show') // initializes and invokes show immediately +$('#myModal').modal() // initialized with defaults +$('#myModal').modal({ keyboard: false }) // initialized with no keyboard +$('#myModal').modal('show') // initializes and invokes show immediately {% endhighlight %}Each plugin also exposes its raw constructor on a Constructor
property: $.fn.popover.Constructor
. If you'd like to get a particular plugin instance, retrieve it directly from an element: $('[rel=popover]').data('popover')
.
Enable manually with:
{% highlight js %} -$(".collapse").collapse() +$('.collapse').collapse() {% endhighlight %}