Create a gist now

Instantly share code, notes, and snippets.

Slide implementation zeptojs
(function ($) {
$.fn.slideDown = function (duration) {
// get old position to restore it then
var position = this.css('position');
// show element if it is hidden (it is needed if display is none);
// place it so it displays as usually but hidden
position: 'absolute',
visibility: 'hidden'
// get naturally height
var height = this.height();
// set initial css for animation
position: position,
visibility: 'visible',
overflow: 'hidden',
height: 0
// animate to gotten height
height: height
}, duration);
$(function () {
$('.slide-trigger').on('click', function () {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment