top_content 함수가 #test 및 # test1로 교차 페이드하고 싶습니다. 지금 divs #test와 # test1은 간단한 토글을 사용하고 있습니다. 그러나 나는 그 둘을 동시에 페이드 아웃하고 싶습니다.크로스 페이드 애니메이션
$(document).ready(function() {
$('#test, #test1').hide();
$('.home').click(function() {
var id = $(this).html().toLowerCase();
var $top_content = $('#' + id + ':not(:visible)');
if ($('.current').length === 0) {
toggleContent($top_content);
} else {
$('.current').toggle(400, function() {
toggleContent($top_content);
});
}
});
function toggleContent(top_content) {
top_content.toggle(400);
$('.current').removeClass('current');
top_content.addClass('current');
}
$("a.home").click(function() {
$('.active').not(this).removeClass('active');
$(this).toggleClass('active');
});
});
안녕하세요. 바이올린을 제공하는 것이 좋습니다 (장기간의 사용자조차도 좋겠다). 그러나 질문에 코드를 넣으십시오. 고맙습니다! –