Site icon Hip-Hop Website Design and Development

Shut Cell Slide Menu on Click on

I am utilizing Create, a WP theme by Themetrust and reached out on their boards with no reply. I am utilizing the slide menu with easy scroll, the linking/scrolling is working tremendous. As of now the slide menu solely closes when the “x” icon is clicked. When a menu hyperlink is clicked the sleek scroll happens appropriately, however the menu stays seen. I might like for the menu to slip away in an an identical approach because it does when the “x” is clicked.

Within the beneath code I’ve tried switching ‘#menu-toggle-close’ for ‘#slide-panel”. This appears to work in resized cellular browsers however not on an precise cellular gadget. Any recommendation could be appreciated.

Right here is the HTML:

<div id="slide-panel">
    <div class="hidden-scroll">
        <div class="inside has-mobile-menu">

            <nav id="slide-mobile-menu" class="menu-one-page-menu-container"><ul id="menu-one-page-menu" class="collapse sidebar"><li id="menu-item-1274" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-1274"><a href="#our-approach" data-ps2id-api="true">Our Strategy</a></li>

Right here is the operate:

operate initSlideMenu(){
var siteContainer = $j('#site-wrap');
slideMenu = $j('#slide-panel');
slideMenuWidth = slideMenu.outerWidth();
$j('.menu-toggle.open').on('click on', operate () {
    slideMenu.css('remodel', 'translateX(0)');        
});
$j('#menu-toggle-close').on('click on', operate () {      
    slideMenu.css('remodel', 'translateX(' + slideMenuWidth + 'px)');     
});
var browserWidth = $j(window).width();
if(isMobile.any() && browserWidth < 768) {
    var browserWidth = $j(window).width();
    slideMenuWidth = browserWidth;
    slideMenu.css('width', browserWidth + 'px');
}
slideMenu.css('remodel', 'translateX(' + slideMenuWidth + 'px)'); 
slideMenu.css('visibility', 'seen'); 

}