jQueryのfadeIn()メソッド
例
すべての<p>要素をフェードインします。
$("button").click(function(){
$("p").fadeIn();
});
定義と使用法
およびfadeIn()メソッドは、選択した要素の不透明度を非表示から表示に徐々に変更します(フェード効果)。
注:非表示の要素はまったく表示されません(ページのレイアウトには影響しなくなりました)。
ヒント:このメソッドは、 fadeOut()メソッドと一緒に使用されることがよくあります。
構文
$(selector).fadeIn(speed,easing,callback)
Parameter | Description |
---|---|
speed | Optional. Specifies the speed of the fading 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 fadeIn() method is completed
To learn more about callback, visit our jQuery Callback chapter |
自分で試してみてください-例
使用速度パラメーターを使用して、フェード効果の速度を指定する方法。
の使用要素をフェードインおよびフェードアウトするときにコールバックパラメーターを使用する方法。