jquery - Sidebar Transition for offcanvas navigation onclick remove class -
i have end this off canvas navigation. if see in demo did if want close sidebar 1 have click anywhere inside body , class sidebar has been removed slide out sidebar.
what want same effect done while on clicking close button inside sidebar sidebar has slide out. how achieve this?
this code used remove class.
var container = document.getelementbyid( 'st-container' ), buttons = array.prototype.slice.call( document.queryselectorall( '#st-trigger-effects > button' ) ), // event type (if mobile use touch events) eventtype = mobilecheck() ? 'touchstart' : 'click', resetmenu = function() { classie.remove( container, 'st-menu-open' ); }, bodyclickfn = function(evt) { if( !hasparentclass( evt.target, 'st-menu' ) ) { resetmenu(); document.removeeventlistener( eventtype, bodyclickfn ); } };
thanks
i think familiar jquery:
$(document).ready(function () { $('#your-close button-id').on('click', function () { $(this).removeclass('st-menu-open'); }); });
Comments
Post a Comment