code as folloes:

html code:

<a>click</a>

<div id = "show" style = "display : none"></div>

 

jquery code:

$(function(){

  $('a').click(function(){

    var showValue = $('#show').css('display'); //返回到id = show的div的display的值

    if(showValue == "" || showValue = "none"){

       $('#show').css({display:block});

    }else if(showValue == "block"){

        $('#show').css({display:none});

    }

  })

})

 

OK,我们通过判断display属性的none与block,实现简单的隐藏于现实效果。

相关文章:

  • 2021-05-11
  • 2021-12-25
  • 2022-12-23
  • 2021-11-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-17
  • 2021-11-27
  • 2021-09-10
  • 2022-01-18
  • 2021-12-18
  • 2021-09-14
相关资源
相似解决方案