\r\n\r\n 
 
상단에 고정된 영역
제이쿼리를 이용...","url":"https://sir.kr/boards/program/19753","author":{"@type":"Person","name":"잘살아보자","url":"https://sir.kr/profile/c9d1f864-2b7e-4116-ac49-2d75ac933824"},"interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"datePublished":"2014-10-17T03:14:20+09:00","dateModified":"2014-10-17T03:14:20+09:00"}

브라우저 상단에 고정 시키는 제이쿼리 소스

· 11년 전 · 4804

<script src="http://code.jquery.com/jquery-latest.js"></script>


<script type="text/javascript">
$(function(){
    var menupos = $("#header").offset().top;
    $(window).scroll(function(){
       if($(window).scrollTop() >= menupos) {
          $("#header").css("position","fixed");
          $("#header").css("top","0");
          $('#top_mar').show();
          }
    });
 });
 </script>

 

<header id="#header"> 

<div id="top_mar" style="display:none;">상단에 고정된 영역</div>

</header>

제이쿼리를 이용하여 div 태그를 상단에 고정하는 소스에요.

빨강색 부분에 네비게이션 메뉴 코딩을 넣으면 메뉴를 상단에 고정하는 소스로 활용도 할 수 있어요 

 

 

 

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

프로그램

+
제목 글쓴이 날짜 조회
11년 전 조회 2,194
11년 전 조회 2,658
11년 전 조회 2,661
11년 전 조회 1,880
11년 전 조회 2,551
11년 전 조회 2,212
11년 전 조회 1,963
11년 전 조회 6,113
11년 전 조회 5,663
11년 전 조회 2,202
11년 전 조회 5,507
11년 전 조회 5,076
11년 전 조회 5,468
11년 전 조회 6,342
11년 전 조회 6,021
11년 전 조회 5,546
11년 전 조회 2,054
11년 전 조회 6,932
11년 전 조회 2,805
11년 전 조회 2,306
11년 전 조회 4,285
11년 전 조회 2,238
11년 전 조회 3,938
11년 전 조회 3,521
11년 전 조회 2,693
11년 전 조회 2,912
11년 전 조회 2,239
11년 전 조회 3,397
11년 전 조회 2,193
11년 전 조회 6,726
11년 전 조회 3,558
11년 전 조회 4,643
11년 전 조회 2,287
11년 전 조회 2,438
11년 전 조회 2,321
11년 전 조회 2,877
11년 전 조회 2,269
11년 전 조회 2,910
11년 전 조회 5,536
11년 전 조회 3,352
11년 전 조회 3,323
11년 전 조회 7,285
11년 전 조회 3,233
11년 전 조회 4,099
11년 전 조회 3,719
11년 전 조회 2,353
11년 전 조회 4,474
11년 전 조회 3,814
11년 전 조회 7,184
11년 전 조회 4,805
11년 전 조회 3,286
11년 전 조회 3,466
11년 전 조회 1,908
11년 전 조회 2,780
11년 전 조회 2,301
11년 전 조회 4,888
11년 전 조회 2,725
11년 전 조회 2,695
11년 전 조회 2,873
11년 전 조회 4,988
11년 전 조회 4,941
11년 전 조회 4,714
11년 전 조회 2,381
11년 전 조회 4,745
11년 전 조회 4,001
11년 전 조회 4,485
11년 전 조회 2,022
11년 전 조회 3,803
11년 전 조회 3,782
11년 전 조회 3,861
11년 전 조회 2,851
11년 전 조회 3,310
11년 전 조회 2,654
11년 전 조회 2,443
11년 전 조회 3,073
11년 전 조회 2,371
11년 전 조회 5,249
11년 전 조회 4,872
11년 전 조회 2,629
11년 전 조회 3,861
11년 전 조회 2,299
11년 전 조회 3,064
11년 전 조회 4,696
11년 전 조회 5,016
11년 전 조회 5,926
11년 전 조회 2,295
11년 전 조회 2,859
11년 전 조회 4,293
11년 전 조회 2,472
11년 전 조회 2,465
11년 전 조회 3,050
11년 전 조회 2,335
11년 전 조회 3,594
11년 전 조회 3,105
11년 전 조회 5,194
11년 전 조회 3,620
11년 전 조회 5,887
11년 전 조회 2,707
11년 전 조회 2,535
11년 전 조회 3,208