0
조회 수 : 604 신고 : 0
미리보기 : | https://www.webmini.net/anchor_tab |
---|
script 소스
<script type="text/javascript">
$(document).ready(function(){
/* 탭 클릭 */
$('.anchor_tab li a').on('click',function(){
var anchorId = $(this).attr('data-anchor');
// 스크롤 이동
scroll_to_anchor_tab(anchorId);
});
});
// 탭 이동 - 부드러운 스크롤
function scroll_to_anchor_tab(anchor_id,speed) {
if( !speed ) var speed = 'slow';
var a_tag = $("#"+anchor_id);
if(a_tag.length > 0){
$('html, body').animate({
scrollTop: a_tag.offset().top - $('').height() - $('').height() // 상단에 특정 위치를 제외하고 스크롤할때 해당 이름 작성
}, speed);
}
}
</script>
html 소스
<ul class="anchor_tab">
<li><a href="#" data-anchor="anchor_div">버튼</a></li>
</ul>
버튼 anchor_div 이름은 원하는 이름으로 하되, 클릭 했을때 이동되는 id하고 이름이 같아야합니다.
<div id="anchor_div">
이동했을때 내용
</div>
추천수 10단위당 메달이 1개씩 노출되고, 추천수에 따라 배경색이 변하며, 일정수의 추천수를 받을시 아이콘이 붙게됩니다.
- 추천수 50개이상
- 추천수 30개이상
- 추천수 20개이상
- 추천수 10개이상
- 추천수 3개이상
첫번째 댓글을 남겨주세요!