画布菜单链接损坏 [英] offcanvas menu link broken

查看:16
本文介绍了画布菜单链接损坏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为学校做一个项目,我遇到了一个问题,我希望有人能够帮助解决(并可能抑制我对 joomla 日益恶化的仇恨,但这不是重点:)

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 :)

首先,这是网址:http://edcc3.cloudaccess.net

问题是,当您调整浏览器大小或使用模拟器查看 480 像素设备上的渲染时,offcanvas 菜单链接将不起作用.这意味着他们不会滚动到一页布局中的目标部分,我不知道为什么.我打赌这是一个订购问题,但对于我的生活,我找不到问题所在.任何帮助将不胜感激!

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!

推荐答案

好吧,我已经为你写了一个我已经测试过并且有效的小例子:

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();
});

上面的 jQuery 代码,检测对菜单项定义的 ID 的点击并关闭画布显示.然后锚点/滚动条就会开始.

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.

请注意,因为这是 Joomla,您可能需要为菜单执行模板覆盖,Yootheme 已经完成了.

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

希望能帮到你

这篇关于画布菜单链接损坏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆