jQuery UI API - 跳動特效(Pulsate Effect)
所屬類別
用法
描述:跳動特效(Pulsate Effect)通過跳動來隱藏或顯示一個元素。
pulsate
| 參數 | 類型 | 描述 | 默認值 |
|---|---|---|---|
| times | Integer | 元素跳動的次數。當隱藏或顯示時,會添加半個跳動。 | 5 |
實例
使用跳動特效(Pulsate Effect)切換一個 div。
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>跳動特效(Pulsate 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( "pulsate" );
});
</script>
</body>
</html>
