Jquery-effect-pulsate
提供:Dev Guides
jQuery効果-脈動効果
説明
*Pulsate* エフェクトは、effect()メソッドで使用できます。 これにより、要素の不透明度が複数回脈動します。
構文
この効果を使用するための簡単な構文は次のとおりです-
selector.effect( "pulsate", {arguments}, speed );
パラメーター
ここにすべての引数の説明があります-
- times -脈動する時間。 デフォルトは3です。
- mode -エフェクトのモード。 「表示」、「非表示」にすることができます。 デフォルトは「show」です。
例
以下は、この効果の使用法を示す簡単な例です-
<html>
<head>
<title>The jQuery Example</title>
<script type = "text/javascript"
src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js">
</script>
<script type = "text/javascript"
src = "https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.3/jquery-ui.min.js">
</script>
<script type = "text/javascript" language = "javascript">
$(document).ready(function() {
$("#button").click(function(){
$(".target").effect( "pulsate", {times:5}, 3000 );
});
});
</script>
<style>
p {background-color:#bca; width:200px; border:1px solid green;}
div{ width:100px; height:100px; background:red;}
</style>
</head>
<body>
<p>Click the button</p>
<button id = "button"> Pulsate </button>
<div class = "target">
</div>
</body>
</html>
これにより、次の結果が生成されます–