mirror of
https://github.com/twbs/bootstrap.git
synced 2025-09-28 14:29:07 +02:00
tabssss
This commit is contained in:
35
docs/assets/js/bootstrap-tabs.js
vendored
Normal file
35
docs/assets/js/bootstrap-tabs.js
vendored
Normal 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 )
|
Reference in New Issue
Block a user