jQuery slideDown()メソッド
例
すべての非表示の<p>要素を下にスライド(表示)します。
$("button").click(function(){
$("p").slideDown();
});
定義と使用法
slideDown()メソッドは、選択した要素を下にスライド(表示)します。
注: slideDown()は、jQueryメソッドで非表示になっている要素とCSSのdisplay:noneで機能します(ただし、visibility:hiddenでは機能しません)。
ヒント:要素をスライドアップ(非表示)するには、 slideUp()メソッドを確認してください。
構文
$(selector).slideDown(speed,easing,callback)
Parameter | Description |
---|---|
speed | Optional. Specifies the speed of the slide effect. Default value is 400 milliseconds Possible values:
|
easing | Optional. Specifies the speed of the element in different points of the animation. Default value is "swing" Possible values:
|
callback | Optional. A function to be executed after the slideDown() method is completed
To learn more about callback, visit our jQuery Callback chapter |
自分で試してみてください-例
使用速度パラメーターを使用して、スライド効果の速度を指定する方法。
の使用選択した要素を上下にスライドするときにコールバックパラメーターを使用する方法。