당신은 아직 $(document).ready()
만 페이지로드 또는 페이지 새로 고침에 해고 발견하지 않은 경우. 같은 페이지의 URL에 단편을 추가하는 <a>
태그를 클릭해도 페이지 자체가 다시로드되지 않습니다.
따라서 클릭에 대한 다른 처리기가 click()
이벤트로 필요합니다.
$('.litem a').click(function() {
ShowPage($(this).attr('href').substring(1))
});
function ShowPage(a) {
$(".page").css("display", "none");//.hide() will do
//don't need to set display, fadeIn already does that
$("#body_" + a).fadeIn(1000)//.css("display", "block");
//window.location.hash = "#" + a;, it's not necessary to reset the hash
$(".litem").attr("id", "");
$("li[name=" + a + "]").attr("id", "selected")
}
이 작동 어쨌든 (올바른 페이지로의 링크를 하드 링크를 만드는 등의 index.php) 사용자가 자바 스크립트 장애인이있는 경우 – Julian