jQuery随便控制任意div隐藏的方法

Jennifer ·
更新时间:2024-09-21
· 950 次阅读

代码如下:
<!DOCTYPE html>
<html>
<head>
  <style>
  div { background:#ece023; width:30px;
        height:40px; margin:2px; float:left; }
  </style>
  <script src="http://code.jquery.com/jquery-latest.min.js"></script>
</head>
<body>
  <div>a</div>
  <div>b</div>
  <div>c</div>
  <div>d</div>
  <div>e</div>
  <div>f</div>
<script>
    $("div").click(function () {
      $(this).hide(1000);
    });
</script>
</body>
</html>



方法 div隐藏 jQuery div

需要 登录 后方可回复, 如果你还没有账号请 注册新账号