1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-09-28 14:29:07 +02:00
This commit is contained in:
Jacob Thornton
2011-09-08 19:13:08 -07:00
parent fb8987148a
commit 8d2f14d8d0
2 changed files with 101 additions and 0 deletions

35
docs/assets/js/bootstrap-tabs.js vendored Normal file
View File

@@ -0,0 +1,35 @@
(function( $ ){
function activate ( element, container ) {
container.find('.active').removeClass('active')
element.addClass('active')
}
function tab( e ) {
debugger
var $this = $(this)
, href = $this.attr('href')
if (/^#/.test(href)) {
e.preventDefault()
if ($this.hasClass('active')) {
return
}
activate($this, $ul)
activate($(href), $content)
}
}
/* TABS PLUGIN DEFINITION
* ====================== */
$.fn.tabs = function ( content ) {
return this.each(function () {
$(this).delegate('> li > a', 'click', tab)
})
}
})( jQuery || ender )