jQuery UI API - 剪輯特效(Clip Effect)
所屬類別
用法
描述:剪輯特效(Clip Effect)通過垂直或水準方向夾剪元素來隱藏或顯示一個元素。
clip
| 參數 | 類型 | 描述 | 默認值 |
|---|---|---|---|
| direction | String | 剪輯特效隱藏或顯示元素的方向。 vertical 剪輯上下邊緣,horizontal 剪輯左右邊緣。 |
"vertical" |
實例
使用剪輯特效(Clip Effect)切換一個 div。
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>剪輯特效(Clip Effect)演示</title>
<link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
<style>
#toggle {
width: 100px;
height: 100px;
background: #ccc;
}
</style>
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
</head>
<body>
<p>點擊任意地方進行切換。</p>
<div id="toggle"></div>
<script>
$( document ).click(function() {
$( "#toggle" ).toggle( "clip" );
});
</script>
</body>
</html>
