이 화살표를 누르면 왜 맨위로가는거죠? 맨위말고 다른 게시판으로 들어가게끔은 못하나요?
본문
이 화살표를 누르면 왜 맨위로가는거죠? 맨위말고 다른 게시판으로 들어가게끔은 못하나요? 필요하신거가 있으면 다드리겠습니다... 너무감사합니다... 존경합니다 모두...
이거는 css파일에 있는거구용...
/*메인_중간레이아웃 */
#idx_wrapper {z-index:5;width:100%;min-width:1000px;zoom:1;background:#f1f1f1;padding-bottom:30px}
#idx_wrapper:after {display:block;visibility:hidden;clear:both;content:""}
#idx_container {border:1px solid #d4e2e1;z-index:4;position:relative;width:998px;margin:0 auto ;min-height:500px;height:auto !important;height:500px;border-right:1px solid #dde4e9;background:#fff;font-size:1em;zoom:1;margin-top:-50px}
#idx_container:after {display:block;visibility:hidden;clear:both;content:""}
#top_btn{position:fixed;top:70%;right:20px;background:#fff;width:50px;height:50px; background:url(../img/top_btn.gif) no-repeat;text-indent:-9999px;overflow:hidden;opacity:0.8}
#banner{position:fixed;top:90%;right:40px;background:#fff;width:100px;height:100px; background:url(../img/top_btn2.gif) no-repeat;text-indent:-9999px;overflow:hidden;opacity:0.8}
이거는 tail파일에 있는거 입니다.
<a href="#hd" id="top_btn">상단으로</a>
<a href="#hd" id="banner">상단으로</a>
<script>
$(function() {
$("#top_btn").on("click", function() {
$("html, body").animate({scrollTop:0}, '500');
return false;
});
});
</script>
<script>
$(function() {
$("#banner").on("click", function() {
$("html, body").animate({scrollTop:0}, '500');
return false;
});
});
</script>
!-->!-->
답변 1
$("html, body").animate({scrollTop:0}, '500');
이부분을
window.location.href = '경로';
으로 바꾸시면 클릭하시면 해당경로로 이동하게됩니다
답변을 작성하시기 전에 로그인 해주세요.