1

我正在研究一个 wordpress 主题并遇到了一个奇怪的问题。

这是我正在开发的网站http://dalya.go-demo.com/

我想通过单击右侧的菜单按钮来展开菜单。而不是想在点击关闭按钮时关闭它。

请参阅下面的代码。

jQuery(document).ready(function () {
    $ = jQuery;

    function closeNav() {
        $('.close-nav').click(function (e) {
            e.preventDefault();
            $('.nav-area').children('nav').hide( 'slide', { direction: "right" }, 500);
            $(this).addClass('open-nav');
            $(this).removeClass('close-nav');
            openNav();
        });
    }

closeNav();

    function openNav() {
        $('.open-nav').click(function (e) {
            e.preventDefault();
            $('.nav-area').children('nav').show( 'slide', { direction: "right" }, 500);
            $(this).addClass('close-nav');
            $(this).removeClass('open-nav');
            closeNav();
        });
    }

openNav();

    $('.nav-area ul').children('li').children('a').hover(function () {
        $(this).children('span').animate({top:'-54px'});
        $(this).children('div.animated').show( 'slide', {direction: "up"}, 500);
    }, function () {
        $(this).children('span').animate( {top:'0px'} );
        $(this).children('div.animated').hide( 'slide', { direction: "up" } , 500);
    });

});

但我收到以下错误:

错误:TypeError:x.easing[this.easing] 不是函数源文件:.../wp-includes/js/jquery/jquery.js?ver=1.10.2 行:5

我已经在这个论坛上测试了所有可能的解决方案,但没有成功。

  • 添加了 jQuery。
  • 添加了 jQuery UI。
  • 添加了 jQuery 缓动。

  • 没有添加双 jquery。

相同的代码在我的网站的 HTML 版本中运行良好,但在 Wordpress 版本中我遇到了这个问题。

4

1 回答 1

1

我有同样的问题,不得不加入 jquery easing 插件。

http://gsgd.co.uk/sandbox/jquery/easing/

于 2014-03-04T00:54:13.520 回答