1. 定义四种常用隐藏元素的方式,然后调用  jq 的 show 方法显示,观察各原先隐藏元素的   display   表现,结合 jq 源码,show 方法设置 元素 display  属性值为 隐藏时的 display 

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
    *{
      margin: 0;
      padding: 0;
    }
    ul,li{
      border: 1px solid red;
      color: red;
    }
    .hide{
      display: none;
    }
    .inline-block{
      display: inline-block;
    }
    .wrap li:nth-child(4){
      display: none;
    }
  </style>
</head>
<body>
  
  <ul class="wrap">
    <li style="display: none;">style="display: none;"</li>
    <li class="hide">class="hide" +  display:list-item;</li>
    <li class="hide inline-block">class="hide" +  display:inline-block;</li>
    <li>display:list-item;</li>
  </ul>
  <script src="jquery-1.9.1.min.js"></script>
  <script>
    $('.wrap li').show();
  </script>
</body>
</html>
View Code

相关文章:

  • 2021-11-20
  • 2022-02-06
  • 2021-11-30
  • 2021-07-09
  • 2021-12-12
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-23
  • 2021-04-15
  • 2021-06-19
  • 2021-09-09
  • 2021-08-01
相关资源
相似解决方案