把//若当前点击项下的展开关闭项是显示的,则关闭,同时展开另外项中的第一个
_boxItem.eq(_index).hide().end().not(':eq('+_index+')').first().show();
_icoItem.eq(_index).text('+').end().not(':eq('+_index+')').first().text('-');去掉另外 把你的代码简化一些吧 有点啰嗦~~
$(function(){
$('.jq h2')
.on('mouseover',function(){
if($(this).next().css('display')==='none'){
$('.jq .box:visible').prev().find('span').text('+') && $('.jq .box').hide();
$(this).next().show() && $('span',this).text('-');
}
})
.eq(0).find('span').text('-').parent().next().show();
})
_boxItem.eq(_index).hide().end().not(':eq('+_index+')').first().show();
_icoItem.eq(_index).text('+').end().not(':eq('+_index+')').first().text('-');去掉另外 把你的代码简化一些吧 有点啰嗦~~
$(function(){
$('.jq h2')
.on('mouseover',function(){
if($(this).next().css('display')==='none'){
$('.jq .box:visible').prev().find('span').text('+') && $('.jq .box').hide();
$(this).next().show() && $('span',this).text('-');
}
})
.eq(0).find('span').text('-').parent().next().show();
})
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货