0.0.11 • Published 7 years ago

zlide v0.0.11

Weekly downloads
3
License
ISC
Repository
github
Last release
7 years ago

zlide

about

slider functionality from jQuery.slideToggle, jQuery.slideUp, jQuery.slideDown but with CSS transition on max-height. Same idea as this https://github.com/BrentonCozby/dom-slider but minimalistic. You have to apply css transition styling to your element. Inert is supported. (uses display: none when collapsed)

demo

Usage example

Look in dist/index.html for css setup example.

.zlide-inert{
  display: none !important;
}

.my-element {
  transition: max-height 200ms;
  padding-top: 0;
  padding-bottom: 0;
}
var myElement = document.querySelector('.my-element');

function doneCallback(props) {
  console.log('done ' + props.type);
}

function beforeCallback(props) {
  console.log('doing ' + props.type);
}

zlide.down({element: myElement, beforeCallback, doneCallback});

zlide.up({element: myElement, beforeCallback, doneCallback});

zlide.toggle({element: myElement, beforeCallback, doneCallback});

api

var myElement = document.querySelector('.my-element');

function doneCallback(props) {
  console.log('done ' + props.type);
}

function beforeCallback(props) {
  console.log('doing ' + props.type);
}
  • zlide.up({element: myElement, beforeCallback, doneCallback) (same as zlide.collapse)
  • zlide.down({element: myElement, beforeCallback, doneCallback) (same as zlide.expand)
  • zlide.toggle({element: myElement, beforeCallback, doneCallback)
  • zlide.setToCollapsed({element: myElement, beforeCallback, doneCallback)
  • zlide.setToExpanded({element: myElement, beforeCallback, doneCallback)

cdn

https://unpkg.com/zlide/

development

  • git clone/download project
  • npm install
  • npm start
  • go to localhost:3000

build

  • npm run clean
  • npm run build
  • npm run minify
  • look in dist folder

how does it work?

CSS transition on dynamically max-height value and transitionend event.

0.0.11

7 years ago

0.0.10

7 years ago

0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago