开发者

dropdown menu stops working after page jump

开发者 https://www.devze.com 2023-04-07 16:27 出处:网络
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 proble

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 开发者_如何学Pythonwould immensely appreciate any guidance in this regard.


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.


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?!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号