1.0.0 • Published 6 years ago

@ak1ra/jquery-collapsible v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

jquery.collapsible.js

Basic setup

$('.is-collapsible').collapsible({
  open: true
});

Options

Example:

settings: {
  debug: true,
  open: true
}
OptionTypeDefaultInfo
debugboolfalseshow debug messages eg function calls
triggerselector'.trigger'the trigger selector, must be located inside the init-element
contentselector'.content'
triggerClassstring'trigger'
contentClassstring'content'
openboolfalsedefault state on init
classPrefixstring'collapsible-'
openClassstring'open'
closeClassstring'close'
indicatorClassstring'indicator'
indicatorParentbool or stringfalseoptions: 'trigger', 'content' or 'parent'
openTextstring'Show details'
closeTextstring'Hide details'
calcDeltafunctionfunction () { return 0; }
activeToggleboolfalse
animatedbool truewhether or not the collapsing should be animated by JS

(public) Functions

Note: status true equals the collapsible is open.

Example:

$('.foo').collapsible('toggle'[, false]);
// return status
FunctionArgumentsReturnInfo
destroynonenoneReturn the markup to the state before the collapsible was initiated.
getStatusnonestatus (bool)Returns the current state of the collapsible.
togglestatus (bool)status (bool)Toggle the visibility of the content. The status-argument can be passed to force a state.
updatenonestatus (bool)

Events

EventDataInfo
adjust-viewportstatus (bool)will be triggered, if the viewport needed to be adjusted to show the start of the content
createstatus (bool)
before-createstatus (bool)
updatestatus (bool)
before-updatestatus (bool)
togglestatus (bool)
before-togglecurrent status (bool), new status (bool)
initstatus (bool)
destroystatus (bool)
before-destroystatus (bool)

TODOs

  • finish documentation