
页眉是使用"Elementor - Header,Footer & Blocks“插件设计的。下拉菜单不工作。已尝试激活、停用插件、清除缓存。
网站链接:https://www.party-monsters.com/


发布于 2021-04-08 14:06:56
在下面的代码中尝试一下。代码放在活动的主题functions.php文件中。
function add_custom_js(){
?>
<script type="text/javascript">
(function($){
$(document).ready(function(){
$('.hfe-has-submenu .hfe-menu-item').on('click',function(e){
e.preventDefault();
if( $(this).closest('li').find('.sub-menu').css('opacity') === '0' ){
$(this).closest('li').find('.sub-menu').css({"visibility": "visible", "opacity": "1"});
}else{
$(this).closest('li').find('.sub-menu').css({"visibility": "hidden", "opacity": "0"});
}
});
});
})(jQuery);
</script>
<?php
}
add_action( 'wp_footer', 'add_custom_js', 10, 1 );经过测试,效果良好。

https://stackoverflow.com/questions/66993096
复制相似问题