Skip to content

Instantly share code, notes, and snippets.

@nisar1
Last active August 29, 2015 13:57
Show Gist options
  • Save nisar1/9524421 to your computer and use it in GitHub Desktop.
Save nisar1/9524421 to your computer and use it in GitHub Desktop.
toggle 2 function in jQuery
jQuery('.barmenu').click(function () {
var lwidth = '260px';
if (!jQuery(this).hasClass('open')) {
jQuery('.rightpanel, .headerinner, .topbar').css({ marginLeft: lwidth }, 'fast');
jQuery('.leftpanel').css({ marginLeft: 0 }, 'fast');
jQuery(this).addClass('open');
} else {
jQuery('.rightpanel, .headerinner, .topbar').css({ marginLeft: 0 }, 'fast');
jQuery('.leftpanel').css({ marginLeft: '-' + lwidth }, 'fast');
jQuery(this).removeClass('open');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment