topical media & game development
mobile-query-three-www-vendor-bootstrap-docs-assets-js-bootstrap-collapse.js / js
/* =============================================================
* bootstrap-collapse.js v2.0.0
* http://twitter.github.com/bootstrap/javascript.html#collapse
* =============================================================
* Copyright 2012 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ============================================================ */
!function( element = element
this.options = .fn.collapse.defaults, options)
if (this.options["parent"]) {
this.element.hasClass('width')
return hasWidth ? 'width' : 'height'
}
, show: function () {
var dimension = this.dimension()
, scroll = parent && this.element[dimension](0)
this.transition('addClass', 'show', 'shown')
this.element[0][scroll])
}
, hide: function () {
var dimension = this.dimension()
this.reset(this.element[dimension](0)
}
, reset: function ( size ) {
var dimension = this.dimension()
this.element.addClass('collapse')
}
, transition: function ( method, startEvent, completeEvent ) {
var that = this
, complete = function () {
if (startEvent == 'show') that.reset()
that.element
.trigger(startEvent)
[method]('in')
element.hasClass('collapse') ?
this..support.transition.end, complete) :
complete()
}
, toggle: function () {
this[this..fn.collapse = function ( option ) {
return this.each(function () {
var this.data('collapse')
, options = typeof option == 'object' && option
if (!data) .fn.collapse.defaults = {
toggle: true
}
this = this, href
, target = this.attr('href')) && href.replace(/.*(?=#[^\s]+this.data()
target.collapse(option)
})
})
}( window.jQuery )
(C) Æliens
04/09/2009
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.