2
내 탐색이 페이지를로드하지 않고로드되기를 원합니다. 모두 작동합니다. 그러나 내비게이션 요소 <li> nav </li>
은 다른 스타일을 가진 클래스를 가져야합니다. "활성"입니다. 나는이 시도했지만 작동하지 않습니다, 당신 CANN 내 page 코드에 무슨 일이 일어 나는지 :JQuery 탐색 세트 클래스
$('#content').children('section').not('#home').hide();
$(".a").hasClass('navigation-element').parent().removeClass('active');
$(".a").click(function(e){
e.preventDefault();
if ($(this).hasClass('navigation-element')){
var $target = $('#' + $(this).attr('href')).stop(true, true);
var $secs = $('#content > section').not($target).stop(true, true).filter(':visible');
if ($secs.length) {
$secs.fadeOut(function() {
$target.fadeIn();
$(this).parent().addClass('active');
});
} else {
$target.fadeIn();
}
} else if ($(this).hasClass('hide')){
$(this).parent().fadeOut();
}
});
오류는 라인 2에 있고 12