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

상단메뉴 고정하기

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

게시글 목록

번호 제목
24318
24317
24315
24309
24294
24293
24277
24262
24260
24253
24251
24236
24233
24228
24226
24221
24214
24203
24201
24199
24196
24195
24194
24192
24191
24187
24185
24183
24172
24168