: span classes in navigation menu disable smooth scrolling effect
: thaimacky August 22, 2015, 04:21:00 PM
the native menus in this theme look like this:
<a class="_mPS2id-h" rel="m_PageScroll2id" href="/#modernes-webdesign"> <span onclick="window.document.location.href='/#modernes-webdesign'">Angebot </span> [/url]
for this part:
...it seems like there is no use for it apart from destroying the smooth scrolling effect of the plugin "Page scroll to id" i use in that theme. when i delete that span-part in the "inspect element browser tool" the smooth scrolling works perfectly.
the code looks like this after i delete the span class and the menu looks and behaves the same as before apart from the smooth scrolling that works now:
<a class="_mPS2id-h" rel="m_PageScroll2id" href="/#modernes-webdesign"> Angebot[/url]
so, does the span class do something usefull or can i delete it....aaand if it is not needed, how can i delete it?
the site (which is still under construction) is here http://neue-webseite.ch and the menu link with the smooth scrolling effect that does only work smoothly without the above span class is the first one called "angebot"...
: Re: span classes in navigation menu disable smooth scrolling effect
: Tristan Rineer August 24, 2015, 02:40:54 PM
The span allows users on touch-screen devices to access sub-menus; without it, tapping on the menu item would always follow the link; with it, there will be an arrow for menu items with submenus, and tapping the arrow will expand the submenu.
The framework actually has smooth-scroll built in, but it's designed to only work with HTML elements that have an ID starting with "s5_".
As for actually removing the spans, I forwarded your question to one of the devs that worked on the menu, here's the response:
If he's asking if he can easily remove the surrounding spans, the answer is no, it's part of the framework. First, if he wants to hack up the menu that's on him to do so, we can't support that. There is an A and a Span inside of it for when there are sub menus. The arrow is set as the background of the A, and the Span surrounds only the text. That allows the arrow and the text to have two different trigger methods, which means the user can open the sub menu on touch screen devices by clicking the arrow (A) and open that specific menu link of the Span by clicking on the text. Otherwise there would be no way to open a sub menu, it would always open the link of the parent item.
His site has no sub menus so if wants to modify the framework to remove it, he can, but that's totally on him to do so.
I hope that is helpful information.