我正在研究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 Easing。
未添加双重jquery。
相同的代码在我的网站HTML版本中运行良好,但在Wordpress版本中我遇到了这个问题。