页面跳转后下拉菜单停止工作
当我试图找出页面跳转到锚点时下拉菜单停止工作的原因时,我的头快要爆炸了。跳转也涉及一些 JS,但即使是普通的 html 锚点跳转也存在同样的问题。
该页面位于 http://mincovlawyer.com/doc/euro-excellence
当您加载页面,请将鼠标悬停在“法律”、“关于”和“好东西”上,然后查看下拉菜单的操作方式。
然后单击右侧边栏中的任意链接,例如 Alt。 #1.
然后再次将鼠标悬停在菜单项上,观察不再出现下拉菜单。
我将非常感谢这方面的任何指导。
My head is about to explode as I try to figure out the reason why my dropdown menu stops working as soon as the page jumps to an anchor. There is some JS involved in the jump, too, but the same problem existed even with a plain html anchor jump.
The page is at http://mincovlawyer.com/doc/euro-excellence
As you load the page, please hover over "The Law", "About" and "The Goodies" and see how the dropdown is supposed to operate.
Then click any of the links in the sidebox to the right, for example Alt. #1.
Then hover over the menu items again and observe that no dropdowns emerge anymore.
I would immensely appreciate any guidance in this regard.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
即使您只是向下滚动页面,翻转也会中断。翻转菜单是绝对定位的,导航是固定定位的。您可以将“position:fixed”添加到您的翻转菜单中,或者您可以在下拉菜单代码中添加滚动偏移。
设置“位置:固定”:
在anylinkmenu.css 文件的第8 行,将position:absolute 更改为position:fixed。
The rollover breaks even if you just scroll down the page. The rollover menu is positioned absolute and the navigation is positioned fixed. You could add 'position:fixed' to your rollover menu or you could add the scroll offset in your drop down menu code.
To set 'position:fixed':
At line 8 of the anylinkmenu.css file, change the position:absolute to position:fixed.
看起来它们正在工作,但它们位于页面顶部上方。在单击任何链接之前,请向下滚动一点。然后将鼠标悬停在“法律”上,您会看到菜单垂直移动。
It looks like they're working, but they are above the top of the page. Before clicking on any of the links, scroll down just a little bit. Then hover over "The Law" and you'll see your menu shifted vertically.
现在有很多代码......
你的菜单是在哪里创建的?鼠标悬停的问题
问题1:
为什么还要使用任何 javascript 作为内联锚点?使用 #links 无论如何都会滚动到所述位置,即使没有 JS?!
Now that's a lot of code...
Where's your menu created? The mouse-over stuff
Question1:
Why even using any javascript for an inline-anchor? Using #links scrolls to said position anyways, even without JS?!