我对jquery非常陌生,而且我对这个很感兴趣。我知道这会是件愚蠢的事,但我在这件事上已经花了很长时间了。
我想切换之间的2个或更多的功能,以动画特定的div在网站上。但最后我让菜单项看不见了。
提前感谢!
$(document).ready(function() {
$("#menu-item-13 a").toggle(
function () {
$("#branding").animate({left:416,top:176}).css('z-index', 12);
$("#a").animate({left:659,top:175});
$("#post-2").animate({left:160,top:177});
$("#post-48").animate({left:402,top:324});
$("nav").animate({left:174,top:56});
$("#post-30").animate({left:403,top:842});
$("#post-1").animate({left:902,top:528});
$("#post-60").animate({left:903,top:55});
},
function () {
$("#branding").animate({left:545,top:176}).css('z-index', 12);
$("#a").animate({left:84,top:175});
$("#post-2").animate({left:160,top:85});
$("#post-48").animate({left:45,top:324});
$("nav").animate({left:174,top:56});
$("#post-30").animate({left:403,top:842});
$("#post-1").animate({left:902,top:528});
$("#post-60").animate({left:903,top:55});
});
});发布于 2013-09-24 12:04:00
这个版本的切换(.toggle(function{}, function(){}))是在jQuery版本1.9中删除,所以如果您使用的版本> 1.9,那么调用切换将切换元素的显示。
如果要添加对已删除功能的支持,可以按照升级说明中的指定包括迁移插件。
https://stackoverflow.com/questions/18981122
复制相似问题