UIkit/yootheme Pro Offcanvas hiding

Question

I’m working on a wordpress website: http://marioorsi.sviluppo.host/ with Youtheme Pro installed and based on UIkit Framework.
I need to hide offcanvas menu when user clicks on an anchor link (Chi siamo, Palmares and Contatti).
I found this code on Youtheme forum support:

 jQuery(function() {
        UIkit.components.scroll.options.defaults.offset = 90;
        jQuery('.uk-navbar-nav a, .uk-nav a').each(function() {
            if (location.hostname == this.hostname && location.pathname == this.pathname && this.href != '#') {
                UIkit.scroll(this);
                UIkit.util.on(this, 'beforescroll', function() {
                    UIkit.modal('#tm-mobile').hide();
                });
            }
        });
    });

The first line give me error “Uncaught TypeError: Cannot read property ‘scroll’ of undefined”.
So I tried to delete it. The code works, but I can’t click the toggle to show offcanvas anymore.
Anyone can help me?

--------------------------------------------------

>>> Share a link to this question, just copy and paste the code bellow on your web page <<<

<a href="https://www.wptricks.com/question/uikit-yootheme-pro-offcanvas-hiding/">

UIkit/yootheme Pro Offcanvas hiding</a>
0
Micki Benci 2 months 0 Answers 59 views 0

Leave an answer