Foundation off canvas 菜单在移动设备上始终可见

Foundation off canvas menu always visible on mobile

目前 on this site 关闭 canvas 菜单对于移动设备和小型桌面屏幕始终可见...谁能告诉我我做错了什么?

该站点是使用基于 Zurb Foundation 框架的 Joints WP 主题构建的。

提前致谢, 亚当

您在控制台中出现错误:

Uncaught TypeError: $ is not a function

这表明您遇到了 jQuery 问题,Foundation 使用 jQuery 在小/大屏幕上隐藏导航的(不相关的)部分。

我猜如果你改变这个:

$(document).ready(function() {
    var temp = "";
    $(':input').click(function() {
        temp = $(this).attr('placeholder');
        $(this).attr('placeholder','');
        $(this).blur(function() {
            $(this).attr('placeholder',temp);
        });
    });
});

为此:

jQuery(document).ready(function() {
    var temp = "";
    jQuery(':input').click(function() {
        temp = jQuery(this).attr('placeholder');
        jQuery(this).attr('placeholder','');
        jQuery(this).blur(function() {
            jQuery(this).attr('placeholder',temp);
        });
    });
});

script.js

事情可能会奏效(尽管我还没有检查过代码的贪婪程度)。

查看 http://learn.jquery.com/using-jquery-core/avoid-conflicts-other-libraries/ 了解有关 jQuery 如何 运行 发生冲突的更多信息。