이 내 HTML 코드입니다 :내 Jquery 코드는 한 번만 작동합니까?
<a href="#" class="menu_item"><img src="Home-48.png" alt="education" /></a>
<br /><br />
<a href="#" class="menu_item"><img src="Shield_48.png" alt="education" /></a>
<br /><br />
<a href="#" class="menu_item"><img src="Education-48.png" alt="education" /></a>
<br /><br />
<a href="#" class="menu_item"><img src="Money-Bag-48.png" alt="education" /></a>
이 내 jQuery 코드입니다 : 내가 원하는
$(document).ready(function(){
$('.menu_item1').click(function(){
$('#custom_menu_loading_section').fadeIn(800, function(){
$('#custom_menu').load('education.html', {}, function() { $("#accordion").accordion({ heightStyle: "fill" }); });
});
});
});
이 나는 $("#custom_menu")
으로 이미지에 education.html
로드를 클릭 만하면 한 번만 작동합니다. 예를 들어 첫 번째 이미지를 클릭하면 올바르게 작동하지만 두 번째 이미지를 클릭하면 작동하지 않습니다. 왜?
내 목표 : 전 메뉴 항목을 갖고 싶어 (exapmle 가정을 소개, 연락처, ...) 사용자가 JQuery와 부하, 거기에 외부 파일 (집의 내용을 클릭 할 때. html, about.html, ...)을 "#custom_menu"에 추가하여 "#custom_menu_loading_section"로드 효과를 표시합니다.
오타를 당신의 자바 스크립트? 나는'$ ('. menu_item1') ... '을 보았지만, 당신의 HTML – giorgio