Skip to content

Instantly share code, notes, and snippets.

@mariokostelac
Created January 5, 2014 22:36
Show Gist options
  • Save mariokostelac/8274976 to your computer and use it in GitHub Desktop.
Save mariokostelac/8274976 to your computer and use it in GitHub Desktop.
var $lessonWrapper = $('.course-wrap .lesson-wrapper');
// prevent default animation of right part
$lessonWrapper.css('webkitTransform', 'translateX(0px)');
// allow smooth resizing (just filling with default css value for attribute 'position')
$lessonWrapper.css('position', 'static');
// allow padding animation
$lessonWrapper.css('webkitTransition', 'padding 0.3s');
// force scrollbar to disable animation tilting
$('.course-inner').css('overflowY', 'scroll');
var $toggleButton = $('.toggle-sidebar'),
$courseWrap = $('.course-wrap');
$toggleButton.on('click', function(ev) {
var enabled = $courseWrap.hasClass('with-menu'),
position = enabled === true ? '0px' : '240px';
$lessonWrapper.css('paddingLeft', position);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment