【发布时间】:2021-06-18 03:49:57
【问题描述】:
以下代码在悬停时显示 2 个下拉菜单。
我需要禁用下拉菜单。
我尝试了以下代码,但它仍然下降。
控制台没有错误。
请告诉我如何禁用下拉菜单?
使用插件创建的现有代码:
<div class="elementor-element elementor-element-d9e3cb4 elementor-widget__width-initial elementor-widget elementor-widget-shortcode" data-id="d9e3cb4" data-element_type="widget" data-widget_type="shortcode.default">
<div class="elementor-widget-container">
<div class="elementor-shortcode">
<div class="wpml-ls-statics-shortcode_actions wpml-ls wpml-ls-legacy-dropdown js-wpml-ls-legacy-dropdown" disabled="true">
<ul>
<li tabindex="0" class="wpml-ls-slot-shortcode_actions wpml-ls-item wpml-ls-item-ko wpml-ls-current-language wpml-ls-first-item wpml-ls-item-legacy-dropdown">
<a href="#" class="js-wpml-ls-item-toggle wpml-ls-item-toggle">
<img class="wpml-ls-flag" src="https://www.myweb.com/wp-content/uploads/flags/KO_2.svg" alt="Korean" width="18" height="12"></a>
<ul class="wpml-ls-sub-menu">
<li class="wpml-ls-slot-shortcode_actions wpml-ls-item wpml-ls-item-zh-hans">
<a href="https://www.myweb.com/?elementor_library=header" class="wpml-ls-link">
<img class="wpml-ls-flag" src="https://www.myweb.com/wp-content/uploads/flags/CN_2.svg" alt="Japanese" width="18" height="12"></a>
</li>
<li class="wpml-ls-slot-shortcode_actions wpml-ls-item wpml-ls-item-en wpml-ls-last-item">
<a href="https://www.myweb.com/?elementor_library=header" class="wpml-ls-link">
<img class="wpml-ls-flag" src="https://www.myweb.com/wp-content/uploads/flags/EN_2.svg" alt="English" width="18" height="12"></a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
</div>
我尝试过的代码:
jQuery(".wpml-ls-legacy-dropdown").prop("disabled", true);
jQuery(".wpml-ls-legacy-dropdown").attr("disabled", true);
谢谢你。
【问题讨论】:
-
试试:
jQuery(".wpml-ls-legacy-dropdown").css('pointer-events','none'); -
嗨斯瓦蒂:哇,你真是太棒了!你总是有答案。我真的很佩服你。非常感谢斯瓦蒂:)