Skip to content

Instantly share code, notes, and snippets.

@Rockbeard
Last active March 19, 2018 12:37
Show Gist options
  • Save Rockbeard/61ee5a8387cc7ef773ba2395abe29c50 to your computer and use it in GitHub Desktop.
Save Rockbeard/61ee5a8387cc7ef773ba2395abe29c50 to your computer and use it in GitHub Desktop.
/* ===============================
* SLIDE MENU
** =============================== */
jQuery(document).ready(function(){
let btnOpen = jQuery('#aside-open'),
btnClose = jQuery('#aside-close'),
eAside = jQuery('.rosa_aside'),
eShadow = jQuery('.shadow-aside'),
btns = btnOpen.add(btnClose).add(eShadow),
counter = 0;
function asideToggle(event){
let aside = event.data.aside,
shadow = event.data.shadow;
aside.toggleClass('m_aside-show');
shadow.toggleClass('m_shadow-show');
if(counter > 0) {
aside.toggleClass('m_aside-hide');
shadow.toggleClass('m_shadow-hide');
}
counter++;
}
btns.click({
aside:eAside,
shadow:eShadow
},
asideToggle
);
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment