解決策が見つからない場合を除き、StackExchange に多くの質問を投稿しないようにしています。私はまだ jQuery を学習中で、左側のメニュー スライド パネルのアニメーション化に問題があります。
スライド パネルの目的は、データベースから取得した情報とリンクをユーザーに提供することです。1 つのパネルをアニメーション化し、(現在開いているパネルが既にある場合) アニメーション化してアニメーション化する方法を考え出そうとしています。したがって、一度に開くことができるパネルは 1 つだけです。
これまでの私のコードは次のとおりです。
$(".editor_content").hide();
//Panel 1
$('#tab_editor').toggle(function(){
$('#panel_editor').animate({width:"400px", opacity:1.0}, 500, function() {
$('.editor_content').fadeIn('slow');
$('.wrapper').animate({"left": "190px"}, "slow");
});
},function(){
$('.editor_content').fadeOut('fast', function() {
$('#panel_editor').stop().animate({width:"0", opacity:0.0}, 200);
$('.wrapper').animate({"left": "0px"}, "slow");
});
});
//Panel 2
$('#tab_themer').toggle(function(){
$('#panel_themer').animate({width:"400px", opacity:1.0}, 500, function() {
$('.themer_content').fadeIn('slow');
$('.wrapper').animate({"left": "190px"}, "slow");
});
},function(){
$('.themer_content').fadeOut('fast', function() {
$('#panel_themer').stop().animate({width:"0", opacity:0.0}, 200);
$('.wrapper').animate({"left": "0px"}, "slow");
});
});
両方のパネルの CSS は に設定されていfixed top:0 left:0
ます。
上記のコードでは、パネルがアニメーション化されますが、パネルをクリックしてアニメーション化すると、開いている現在のパネルをアニメーション化する方法がわかりません。
ヘルプやガイダンスをいただければ幸いです。
前もって感謝します。