The following code shows 2 dropdowns on hover.
I need to disable dropdown.
I tried the following code but it still dorps down.
No error in console.
Would you please let me know how to disable dropdown?
Existing code created using a plugin:
<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>
Codes I tried:
jQuery(".wpml-ls-legacy-dropdown").prop("disabled", true);
jQuery(".wpml-ls-legacy-dropdown").attr("disabled", true);
Thank you.
2
Answers
Try to use this:
jQuery(".wpml-ls-legacy-dropdown").prop("readonly", "readonly");
or
jQuery(".wpml-ls-legacy-dropdown").prop("readonly", true);
or try to .attr()
Isn’t that the WPML language switcher? if yes there’s a section in the setting where you can customize the language switcher appearance
https://wpml.org/forums/topic/customize-the-language-switcher/#:~:text=Solution%3A%20In%20order%20to%20change,any%20part%20of%20your%20page.
Under WPML -> languages -> there’s a section where you can customize (or add if it doesn’t exist yet) your language selector
you can even preview how it will be display until it match your needs