Home  >  Q&A  >  body text

jq让自己隐藏,下一个兄弟元素显示,出错,什么问题?

想实现的是点击之后 自己隐藏 下一个兄弟元素显示,以此类推 可出现的结果是 后面的兄弟元素都显示, 求解!

效果:

00000.png

执行代码部分:

001.png

出现的错误效果:

00002.png

求解什么情况?

小白小白2785 days ago1283

reply all(2)I'll reply

  • 数据分析师

    数据分析师2017-10-01 00:41:40

    jq hides itself and displays the next sibling element. An error occurs. What's the problem? -PHP Chinese website Q&A-jq hides itself, the next sibling element is displayed, an error occurs, what is the problem? -PHP Chinese website Q&A

    Let’s take a look and learn.

    reply
    0
  • 迷茫

    迷茫2017-03-07 09:22:20

    var  tag=("#menu_con .tag:visible");
    tag.hide();if(tag.next().length==0){    
       $("#menu_con .tag").eq(0).show();
    }else{
       tag.next().show();
    }


    reply
    0
  • Cancelreply