hide()

功能

隐藏指定的元素。

语法

styler.hide(elm)

参数

  • elm
    HTMLElement对象,指定对象HTML元素

范例

Example: 隐藏对象元素。

<!DOCTYPE html>
<html>
<head>
  <style>
  p { margin: 8px; font-size:16px; }

  </style>
  <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.3/require.min.js"></script>
  
  
  <script>
    require.config({
      baseUrl: "./"
      ,packages : [
         { name: "skylark", location: "../../../src/skylark" },
      ]
    });
  </script>
  
</head>
<body>
 
  <p id="target">This is a hide item </p>
  <p> This is not a  hide item </p>
 
<script>
  require(["skylark/finder","skylark/styler"],function(finder,styler){
    styler.hide(finder.byId("target"));
  });
</script>
 
</body>
</html>