jQueryのソースを見ていたらEffectで設定するspeed(duration)はこうなっていた。
jQuery:
speeds:{
slow: 600,
fast: 200,
// Default speed
_default: 400
}jQuery内部ではこんな感じで使われている。
jQuery:
opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
jQuery.fx.speeds[opt.duration] || jQuery.fx.speeds._default;つまり、そもそも「normal」なんて存在しない。
「fast」か「slow」以外の文字列を渡したらデフォルトに設定された 400 になるんじゃないか!
なんか騙された気分...
調べたついでにイジっておこう。
(function($) {
$.extend($.fx.speeds, {
fastest: 100,
normal:450,
latest: 1000
});
})(jQuery);「normal」を 450 にしたのは、ささやかな抵抗だよ。





0 Comments:
コメントを投稿