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

상단메뉴 고정하기

· 9년 전 · 13120 · 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년 전
ㅠㅠ 왜 않될까요??

게시글 목록

번호 제목
23606
23598
23585
23579
23578
23564
23550
23549
23548
23529
23510
23507
23481
23471
23453
23452
23450
23436
23428
23404
23396
23389
23380
23369
23350
23337
23317
23307
23298
23290