Jquery - How to get the style display attribute “none / block”

后端 未结 5 620
深忆病人
深忆病人 2021-01-30 04:08

Is there a way to get the style: display attribute which would have either none or block?

DIV :

5条回答
  •  余生分开走
    2021-01-30 04:19

    //animated show/hide
    
    function showHide(id) {
          var hidden= ("none" == $( "#".concat(id) ).css("display"));
          if(hidden){
              $( "#".concat(id) ).show(1000);
          }else{
              $("#".concat(id) ).hide(1000);
          }
      }
    

提交回复
热议问题