테스트 사이트 - 개발 중인 베타 버전입니다

상단메뉴 고정하기

· 9년 전 · 13121 · 9
[code]
$(window).scroll(function () {
var height = $(document).scrollTop();
if (parseInt(height) > 0) {
$('#hd').css({
"position": "fixed",
"display": "block",
"width":"100%",
"z-index" : "10000"
});
$('#wrapper').css({
"padding-top":"116px"
});
} else {
$('.hd').css({
"display": "block",
"position":"relative",
"z-index" : "10000"
});
$('#wrapper').css({
"padding-top":"116px"
});
}
});
[/code]


그누보드 기본 템플릿 기준

댓글 작성

댓글을 작성하시려면 로그인이 필요합니다.

로그인하기

댓글 9개

미안하지만 저 스크립트를 어느곳에 넣으면될가요
초보가 보기에는 뭘 어덯게 해야 할지 모르겠내요 ....
위의 스크립트를 애래와 같이 <script type="text/javascript">와 </script>로 감싸서
head.php의 적당한 곳에 넣으시면 상단메뉴(헤드부분)가 고정이 됩니다.

--- 아 래 ---

<script type="text/javascript">
$(window).scroll(function () {
var height = $(document).scrollTop();
if (parseInt(height) > 0) {
$('#hd').css({
"position": "fixed",
"display": "block",
"width":"100%",
"z-index" : "10000"
});
$('#wrapper').css({
"padding-top":"116px"
});
} else {
$('.hd').css({
"display": "block",
"position":"relative",
"z-index" : "10000"
});
$('#wrapper').css({
"padding-top":"116px"
});
}
});
</script>
좋은 팁 감사합니다
9년 전
완전 짱짱, 감사합니다!
정말 감사합니다.^^
7년 전
감사합니다
좋은정보 감사합니다.
정말 고맙습니다.
5년 전
ㅠㅠ 왜 않될까요??

게시글 목록

번호 제목
22896
22895
22885
22875
22872
22862
22860
22855
22849
22846
22824
22812
22809
22801
22795
22786
22765
22756
22739
22735
22685
22639
22636
22607
22605
22603
22592
22583
22578
22577