offcanvas menu link broken

萝らか妹 提交于 2019-12-09 23:52:01

问题


I'm working on a project for school, and I'm having an issue that I hope someone will be able to help with (and possibly curb my festering hatred for joomla, but that's beside the point :)

First, here's the URL: http://edcc3.cloudaccess.net

The issue is, when you resize the browser or use an emulator to see the rendering on 480px devices, the offcanvas menu links won't work. Meaning they don't scroll to the targetted sections within the one page layout, and I cant figure out why. I'm betting it's an ordering issue but for the life of me I can't find the problem. Any help would be appreciated!


回答1:


Right, I've written a small example for you which I've tested and works:

HTML:

<a id="test" href="#test" data-uk-smooth-scroll="">Item</a>

jQuery:

$('#test').on('click', function() { 
    $.UIkit.offcanvas.hide();
});

The above jQuery code, detects a click on the defined ID of the menu item and closes the offcanvas display. The anchor/scroll will then kick in.

Do note that as this is Joomla, you may have to perform a Template Override for the menu, which Yootheme have already done.

Hope this helps



来源:https://stackoverflow.com/questions/26349827/offcanvas-menu-link-broken

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!