アニメーションを無効にする。アニメーション(遷移)の無効化であって結果は変わらない。
サンプル
実行結果
execute
toggle fx
アニメーション ON
Javascript
$('#sample-1').on('click', '.cq-btn', function (e) {
switch ($(e.target).text()) {
case 'execute':
$('#sample-1 .photo').toggle('slow');
break;
case 'toggle fx':
if ($.fx.off === true) {
$('#mode-text').text('アニメーション ON');
} else {
$('#mode-text').text('アニメーション OFF');
}
$.fx.off = !$.fx.off;
break;
}
});
HTML
<div id="sample-1">
<img src="/resource/images/photos/2.jpg" alt="" class="photo">
<div>
<span class="cq-btn m-primary" id="execute-1">execute</span>
<span class="cq-btn m-success" id="execute-2">toggle fx</span>
</div>
<span id="mode-text">アニメーション ON</span>
</div>