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?

0
Micki Benci 3 years 2020-03-29T16:53:34-05:00 0 Answers 74 views 0

Leave an answer

Browse
Browse