Back Menu JS
==============================
==============================
<script>
$(function() {
    //===== Add js-enabled class in body
    $('.custom-menu-primary').
    //========= add mobile-trigger
    $('.custom-menu-primary').
    //========= add child-trigger
    $('.custom-menu-primary .flyouts .hs-item-has-children > a').after(' <div class="child-trigger"><i></i><
    //========= wrap custom-menu-primary with a div
    $('.custom-menu-primary').
    //========= add back menu in each sub menu section
    $('.custom-menu-primary .hs-menu-wrapper > ul ul').prepend('<li class="dl-back"><a href="javascript:void(0);">
    //======== add seprate class in each li
    $('.custom-menu-primary .hs-menu-wrapper > ul li').each(function() {
        $(this).addClass($(this).
    });
    //========= add mobile-open class in body on click of mobile-trigger
 $('.mobile-trigger').click(
     $('body').toggleClass('mobile-
     setTimeout (function(){
      $('.custom-menu-primary .hs-menu-wrapper > ul li').removeClass('
        $('.custom-menu-primary').
        $('.inner-menu-section').
     }, 300);
     return false;
    });
    //========= remove mobile-open class on body click
    $('body').click(function() {
        $('body').removeClass('mobile-
    });
    $('.mobile-trigger,.custom-
        e.stopPropagation();
    });
    //======== child trigger click function
    $('.child-trigger').click(
        $(this).parent('li').
        var currentThis = $(this);
        setTimeout(function() {
            currentThis.parent('li').
        }, 300);
        if ($(this).parent().hasClass('
            $('.inner-menu-section').
            $('.custom-menu-primary').
        }
        if ($(this).parent().hasClass('
            $('.inner-menu-section').
        }
        if ($(this).parent().hasClass('
            $('.inner-menu-section').
        }
        if ($(this).parent().hasClass('
            $('.inner-menu-section').
        }
        if ($(this).parent().hasClass('
            $('.inner-menu-section').
        }
    });
    //======== back menu click function
    $('.dl-back').click(function() {
        $(this).parent().parent().
        var currentThis = $(this);
        setTimeout(function() {
            currentThis.parent().parent().
        }, 300);
        if ($(this).siblings().hasClass('
            $('.inner-menu-section').
            $('.custom-menu-primary').
        }
        if ($(this).siblings().hasClass('
            $('.inner-menu-section').
        }
        if ($(this).siblings().hasClass('
            $('.inner-menu-section').
        }
        if ($(this).siblings().hasClass('
            $('.inner-menu-section').
        }
        if ($(this).siblings().hasClass('
            $('.inner-menu-section').
        }
    });
    //========= Add parent link in child section (optional part)
    $('.dl-back').each(function() {
        var currentText = $(this).parent().siblings('a')
        var currentLink = $(this).parent().siblings('a')
        $(this).after('<li class="parent-link"><a href="' + currentLink + '">' + currentText + '</a></li>');
    });
});
</script>
==============================
<style>
@media (min-width:768px){
 .custom-menu-primary li.dl-back,
 .custom-menu-primary li.parent-link{
  display: none !important;
 }
}
@media (max-width:767px){
     .header-container-wrapper, .body-container-wrapper, .footer-container-wrapper {
         position: relative;
         left: 0;
         transition: all .3s ease-in-out;
    }
     .mobile-open .header-container-wrapper, .mobile-open .body-container-wrapper, .mobile-open .footer-container-wrapper {
         left:-250px 
    }
     .custom-menu-primary{
         position: fixed;
         padding-top: 0;
        /* Makes room for button */
         margin: 0;
         top:0;
         right:-250px;
         background: #f5f5f5;
         width: 250px !important;
         height: 100%;
         transition: all .3s ease-in-out;
         z-index: 999;
         overflow: auto;
         overflow-x: hidden;
    }
     .mobile-open .custom-menu-primary{
         right:0;
    }
     .child-trigger{
         display: block !important;
        /* Hide button on Desktop */
         cursor: pointer;
        /* Mouse pointer type on hover */
         position: relative;
         z-index:1;
         width: 100% !important;
        /* Button width */
         height: 45px !important;
        /* Button height */
         padding: 0 !important;
         margin-top: -45px;
    }
     .custom-menu-primary .hs-menu-wrapper > ul li{
         position:static !important;
    }
     .custom-menu-primary .hs-menu-wrapper.hs-menu-flow-
         position: absolute !important;
         top: 0;
         left: 100%;
         display: block;
         padding: 0;
    }
     .custom-menu-primary .hs-menu-wrapper > ul ul li.dl-back > a {
         text-indent: 30px !important;
         background: #f5f5f5 !important;
    }
     .custom-menu-primary .hs-menu-wrapper > ul ul li.dl-back > a:after {
         content: '';
         background: url(//cdn2.hubspot.net/hubfs/
         position: absolute;
         left: 25px;
         top: 50%;
         margin-top: -4px;
         width: 6px;
         height: 8px;
    }
     .custom-menu-primary .hs-menu-wrapper > ul li.parent-link > a {
         color: #000 !important;
    }
     .custom-menu-primary .hs-menu-wrapper > ul ul {
         display: none !important;
    }
     .custom-menu-primary .hs-menu-wrapper > ul .unActiveMenu{
         display: none !important;
    }
     .custom-menu-primary .hs-menu-wrapper > ul .unActiveMenu > ul.hs-menu-children-wrapper {
         display: none !important;
    }
     .custom-menu-primary .hs-menu-wrapper > ul .activeMenu > ul.hs-menu-children-wrapper {
         display: block !important;
    }
     .inner-menu-section{
         position:relative;
         transition:all 0.3s ease-in-out;
         left:0;
    }
     .inner-menu-section.level-1 {
         left: -250px;
    }
     .inner-menu-section.level-1.
         left: -500px;
    }
     .inner-menu-section.level-1.
         left: -750px;
    }
     .inner-menu-section.level-1.
         left: -1000px;
    }
     .inner-menu-section.level-1.
         left: -1250px;
    }
}
</style>
IF any query regarding contact -- Vishal Gaurav
 
Comments
Post a Comment