0
다음 코드는 페이지를 페이지 아래쪽으로 스크롤하도록합니다. 이 상황에서 페이지가 스크롤되지 않도록하려면 어떻게합니까?해시가 변경 될 때 페이지 스크롤 방지
// If note is clicked, then append id as hashtag at end of url
$("span.note").click(function(e){
e.preventDefault();
window.location.hash = $(this).attr('id');
});
다른'id'를 사용? 너 뭐하려고? –
참조 http://stackoverflow.com/questions/3870057/how-can-i-update-window-location-hash-without-jumping-the-document – phantasm
감사합니다. 이 링크는 내가 필요한 통찰력을 제공했습니다. 내가 해 줄 필요가있는 것은 해시 값에 일부 텍스트를 추가 한 다음 나중에 해시 값을 사용할 때 해당 텍스트를 꺼내는 것입니다. – Stephen305