1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-09-25 21:09:06 +02:00

greatly simply js plugins - remove js api where reasonable

This commit is contained in:
Jacob Thornton
2011-10-19 21:56:06 -07:00
parent c9669be1ec
commit 8545fe9787
10 changed files with 138 additions and 206 deletions

View File

@@ -75,30 +75,7 @@
}
/* SCROLLSPY PLUGIN DEFINITION
* =========================== */
$.fn.scrollSpy = function( options ) {
var scrollspy = this.data('scrollspy')
if (!scrollspy) {
return this.each(function () {
$(this).data('scrollspy', new ScrollSpy( this, options ))
})
}
if ( options === true ) {
return scrollspy
}
if ( typeof options == 'string' ) {
scrollspy[options]()
}
return this
}
$(document).ready(function () {
$(function () {
$('body').scrollSpy('[data-scrollspy] li > a')
})