How to check if a div is visible state or not?

前端 未结 7 2000
不知归路
不知归路 2020-12-24 12:11

I have tabs like this.

  • //content
  • Trying to check it like

    相关标签:
    7条回答
    • 2020-12-24 13:03

      is(':visible') checks the display property of an element, you can use css method.

      if (!$("#singlechatpanel-1").css('visibility') === 'hidden') {
         // ...
      }
      

      If you set the display property of the element to none then your if statement returns true.

      0 讨论(0)
    提交回复
    热议问题