問題フェードインとフェードアウトは散発的です。理想的には、fadeIn()を1つずつ実行したいと思います。一方、fadeOut()は一度にすべてです。これの任意の組み合わせは、私にとっては大丈夫です。
背景:ポートフォリオの一部を非表示にして表示するためのクイックフィルターを作成しました。それをサポートするためのいくつかのアニメーション化されたインタラクションとともに。問題は、私のやりとりが少し不快なことです。そのため、それらの間にトランジションを追加したいと思います。問題は、単純なfadeIn()fadeOut()が本当に不安定なことです。これがその奇抜さのサンプルです:
ライブデモをクリックしてください(私はこのトランジションを印刷ナビゲーションボタンにのみ適用しました)
アップデート
このスクリプトで問題を解決しました
$(".box").find('.video, .print, .web').closest('.box').show();
$(".box").find('.web, .video, .print').closest('.box').fadeOut('fast');
$(".box").find('.print').closest('.box').each(function(index) {
$(this).delay(400*index).fadeIn(300);
});
簡素化されたスクリプト(script.js)
if( id == 'printInteract'){
//used for muliple click to refresh the boxes
$(".box").find('.video, .print, .web').closest('.box').show();
//finds the classes then filters them out
$(".box").find('.web, .video').closest('.box').fadeOut()
//fades in the .box(s) for print
$(".box").find('.print').closest('.box').fadeIn();
}
BOX HTML
<div class="box">
<h1 title="Light me up"></h1>
<div class="innerbox">
<figure><img src="http://4.bp.blogspot.com/-FtykQCyUHtg/T51fiRiRE-I/AAAAAAAADTo/mUiItl6lG0Q/s400/inspirational-animated-photography-awesome-4.gif" /></figure>
<ul class="categorySelect">
<!-- this example has 3 tags so all buttons will show it -->
<li class="print"></li>
<li class="video"></li>
<li class="web"></li>
</ul>
</div>
</div>
<!--end of box-->
遷移トリガーHTML
<li id="printInteract" class="navCenter"><a id="activePrint" class="navBg" href="#"><div class="relativeCenter"><img src="asset/img/print.gif" /><h3 class="print">print</h3></div></a></li>
最後に、これらのボックスが非常にランダムである理由を誰かが説明できますか?ロード時間ですか?それは私のスクリプト階層だけですか(スクリプトの記述が不十分であることはわかっています)jQueryスクリプトの記述にかなり慣れていないため、修正に関するメモは非常に喜ばれます。