Giter Club home page Giter Club logo

jquery-collapsible's Introduction

jquery.collapsible.js

Install

npm install @ak1ra/jquery-collapsible

Basic setup

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

Options

Example:

settings: {
  debug: true,
  open: true
}
Option Type Default Info
debug bool false show debug messages eg function calls
trigger selector '.trigger' the trigger selector, must be located inside the init-element
content selector '.content'
triggerClass string 'trigger'
contentClass string 'content'
open bool false default state on init
classPrefix string 'collapsible-'
openClass string 'open'
closeClass string 'close'
indicatorClass string 'indicator'
indicatorParent bool or string false options: 'trigger', 'content' or 'parent'
openText string 'Show details'
closeText string 'Hide details'
calcDelta function function () { return 0; }
activeToggle bool false
animated bool ย true whether 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
Function Arguments Return Info
destroy none none Return the markup to the state before the collapsible was initiated.
getStatus none status (bool) Returns the current state of the collapsible.
toggle status (bool) status (bool) Toggle the visibility of the content. The status-argument can be passed to force a state.
update none status (bool)

Events

Event Data Info
adjust-viewport status (bool) will be triggered, if the viewport needed to be adjusted to show the start of the content
create status (bool)
before-create status (bool)
update status (bool)
before-update status (bool)
toggle status (bool)
before-toggle current status (bool), new status (bool)
init status (bool)
destroy status (bool)
before-destroy status (bool)

TODOs

  • finish documentation

jquery-collapsible's People

Contributors

dirkpeter avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.