【问题标题】:menu button on mobile screen is not clickable wordpress storefront theme移动屏幕上的菜单按钮不可点击 wordpress 店面主题
【发布时间】:2020-10-19 05:45:19
【问题描述】:

我在我的 wordpress 电子商务商店中遇到了问题,我无法找到错误。

我的 wordpress 网站顶部有一个菜单,它在网络浏览器中运行良好,但是当我在移动屏幕中打开时 它变成了一个菜单按钮,不可点击。请有人帮助我使其可点击以显示下拉菜单项。

Wordpress 主题:店面

网站链接:https://www.nuttynuts.pk/

【问题讨论】:

    标签: wordpress wordpress-theming


    【解决方案1】:

    如果我查看您的代码,handheld-navigation 类的移动菜单在 CSS 中确实有 max-height: 0。单击按钮不会改变这一点,因此您缺少处理此问题的 javascript 函数。你可以通过切换类来做到这一点。

    在您的 css 文件中,添加一个类并为其指定最大高度:

    .my_custom_class { max-height: auto !important; }

    使用 javascript(使用 jquery),您可以在单击按钮时切换此类:

    ( function( $ ) {
        $(document).ready(function () {
          $(".menu-toggle").click(function (e) {
            e.preventDefault();
            $(".handheld-navigation").toggleClass("my_custom_class ");
          });
        });
    }( jQuery ) );
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-12-01
      • 1970-01-01
      • 1970-01-01
      • 2015-07-26
      相关资源
      最近更新 更多