Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('.petra-collapse-nav > li.petra_parent_dropdown > a').each(function(){
- var self = $(this);
- self.on('click', function(e){
- e.preventDefault();
- var current = $(this).parent();
- if (current.hasClass('petra_dropnav-active')) {
- current.removeClass('petra_dropnav-active').closest('li').find('.petra-dropdown-menu').slideUp();
- } else {
- $.when(
- $('.petra_dropnav-active').removeClass('petra_dropnav-active').closest('li').find('.petra-dropdown-menu').slideUp().promise()
- ).done(function() {
- current.addClass('petra_dropnav-active').closest('li').find('.petra-dropdown-menu').delay(200).slideDown().promise()
- });
- }
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement