Jquery-effect-clip
提供:Dev Guides
jQueryエフェクト-クリップエフェクト
説明
- クリップ*効果は、表示/非表示/切り替えで使用できます。 これにより、要素が垂直または水平にクリップされます。
構文
この効果を使用するための簡単な構文は次のとおりです-
selector.hide|show|toggle( "clip", {arguments}, speed );
パラメーター
ここにすべての引数の説明があります-
- 方向-効果の方向。 「垂直」または「水平」にできます。 デフォルトは垂直です。
- mode -エフェクトのモード。 「表示」または「非表示」にできます。 デフォルトは非表示です。
例
以下は、この効果の使用法を示す簡単な例です-
<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() {
$("#hide").click(function(){
$(".target").hide( "clip", {direction: "horizontal"}, 1000 );
});
$("#show").click(function(){
$(".target").show( "clip", {direction: "vertical"}, 1000 );
});
});
</script>
<style>
p {background-color:#bca; width:200px; border:1px solid green;}
</style>
</head>
<body>
<p>Click on any of the buttons</p>
<button id = "hide"> Hide </button>
<button id = "show"> Show</button>
<div class = "target">
<img src = "../images/jquery.jpg" alt = "jQuery"/>
</div>
</body>
</html>
これにより、次の結果が生成されます–