0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-12-13 01:08:58 +01:00
Bootstrap/docs/assets/js/bootstrap-tabs.js
Jacob Thornton 8d2f14d8d0 tabssss
2011-09-08 19:13:08 -07:00

35 lines
631 B
JavaScript

(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 )