jQuery UI API - 爆炸特效(Explode Effect)
所屬類別
用法
描述:爆炸特效(Explode Effect)通過把元素裂成碎片來隱藏或顯示一個元素。
explode
| 參數 | 類型 | 描述 | 默認值 |
|---|---|---|---|
| pieces | Integer | 爆炸裂開的碎片數目,應該是個平方數,任何其他值被舍入到最近的平方數。 | 9 |
實例
使用爆炸特效(Explode Effect)切換一個 div。
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>爆炸特效(Explode 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( "explode" );
});
</script>
</body>
</html>
