Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
476 views
in Technique[技术] by (71.8m points)

javascript - 一种在悬停而不是单击时触发子菜单的方法?(a way to trigger Sub Menus on hover instead of click?)

for the menu widget / how can I have sub-menus trigger on HOVER instead of clicking ?!!!

(菜单小部件/如何在HOVER上具有子菜单触发器而不是单击?!)

if there is no what, how can I do this with custom code / perhaps JS ... ?

(如果没有,我该如何使用自定义代码/也许是JS ...?)

not sure hot to get to JS code used here / this is an WordPress , ELEMENTOR menu widget / and that's the HTML that goes around that sub-menu // is there any possible way to manipulate anything from this HTML to make a JS code that will trigger a click when that menu item is hovered ??

(不确定要在这里使用JS代码很火/这是一个WordPress,ELEMENTOR菜单小部件/就是该子菜单中的HTML //是否有任何可能的方式来操纵此HTML中的任何内容以制作JS代码,悬停该菜单项时将触发单击?)

here is the code from my developer tools inspect element:

(这是我的开发人员工具inspect元素中的代码:)

<a href="#" class="pp-menu-item has-submenu highlighted" id="sm-15751350229339702-1" aria-haspopup="true" aria-controls="sm-15751350229339702-2" aria-expanded="true">My Prescription<span class="sub-arrow"></span></a>

<ul class="sub-menu pp-advanced-menu--dropdown sm-nowrap" id="sm-15751350229339702-2" role="group" aria-hidden="false" aria-labelledby="sm-15751350229339702-1" aria-expanded="true" style="z-index: 3; width: auto; min-width: 10em; display: block; max-width: 1000px; top: auto; left: 0px; margin-left: 0px; margin-top: 0px;">
<li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-407"><a href="https://www.hyatt.icodetheweb.com/refillrx/" class="pp-sub-item">RefillRX</a></li>
<li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-408"><a href="https://www.hyatt.icodetheweb.com/transferrx/" class="pp-sub-item">TransferRX</a></li>
</ul>
  ask by user10366078 translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...