我用jQuery创建了DropDown菜单。除了IE7之外,所有的东西都运行得很好。完全不起作用。它只会将最后一个链接加粗。我不确定如何调试它。
我创建了this fiddle.
有谁有解决方案吗?
这是不起作用的JS:
$(".link-dropdown").on({
click: function(){
var $this = $(this);
if ($this.parent().next().is(":visible")){
$('.opening-holder').hide();
$('.link-dropdown').css({
'fontFamily': 'Geogrotesque-Regular, Arial, sans-serif'
});
} else {
$('.opening-holder').hide();
$('.link-dropdown').css({
'fontFamily': 'Geogrotesque-Regular, Arial, sans-serif'
});
$this.css({
'fontFamily': 'Geogrotesque-SemiBold, Arial, sans-serif'
});
$this.parent().next().show();
$this.parent().next().children().show();
}
return false;
}
});发布于 2012-08-08 20:12:13
我为解决方案http://jsfiddle.net/EMnw3/27/创建了fiddle,我禁用了if visible,它可以工作...
发布于 2012-08-08 19:21:54
这与您使用过:visible的事实有关。
发布于 2012-08-08 19:31:23
试试这个:
我刚刚对jQuery脚本进行了更改,它的工作方式如下:
$(function(){
$(".link-dropdown").on({
click: function(){
var $this = $(this);
if ($this.css("dispaly") == "block;"){
$('.opening-holder').hide();
$('.link-dropdown').css({
'fontFamily': 'Geogrotesque-Regular, Arial, sans-serif'
});
} else {
$('.opening-holder').hide();
$('.link-dropdown').css({
'fontFamily': 'Geogrotesque-Regular, Arial, sans-serif'
});
$this.css({
'fontFamily': 'Geogrotesque-SemiBold, Arial, sans-serif'
});
$this.parent().show();
$this.parent().children().show();
}
return false;
}
});
});https://stackoverflow.com/questions/11863284
复制相似问题