\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년 전 · 4806

<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,196
11년 전 조회 2,658
11년 전 조회 2,663
11년 전 조회 1,882
11년 전 조회 2,552
11년 전 조회 2,215
11년 전 조회 1,963
11년 전 조회 6,121
11년 전 조회 5,666
11년 전 조회 2,202
11년 전 조회 5,509
11년 전 조회 5,080
11년 전 조회 5,471
11년 전 조회 6,345
11년 전 조회 6,024
11년 전 조회 5,547
11년 전 조회 2,057
11년 전 조회 6,933
11년 전 조회 2,806
11년 전 조회 2,308
11년 전 조회 4,286
11년 전 조회 2,238
11년 전 조회 3,942
11년 전 조회 3,521
11년 전 조회 2,696
11년 전 조회 2,912
11년 전 조회 2,244
11년 전 조회 3,397
11년 전 조회 2,194
11년 전 조회 6,727
11년 전 조회 3,559
11년 전 조회 4,644
11년 전 조회 2,287
11년 전 조회 2,440
11년 전 조회 2,324
11년 전 조회 2,877
11년 전 조회 2,270
11년 전 조회 2,914
11년 전 조회 5,538
11년 전 조회 3,352
11년 전 조회 3,324
11년 전 조회 7,287
11년 전 조회 3,235
11년 전 조회 4,103
11년 전 조회 3,724
11년 전 조회 2,356
11년 전 조회 4,475
11년 전 조회 3,818
11년 전 조회 7,188
11년 전 조회 4,807
11년 전 조회 3,288
11년 전 조회 3,467
11년 전 조회 1,910
11년 전 조회 2,780
11년 전 조회 2,301
11년 전 조회 4,890
11년 전 조회 2,725
11년 전 조회 2,697
11년 전 조회 2,878
11년 전 조회 4,990
11년 전 조회 4,942
11년 전 조회 4,714
11년 전 조회 2,383
11년 전 조회 4,747
11년 전 조회 4,002
11년 전 조회 4,487
11년 전 조회 2,024
11년 전 조회 3,804
11년 전 조회 3,784
11년 전 조회 3,862
11년 전 조회 2,854
11년 전 조회 3,314
11년 전 조회 2,657
11년 전 조회 2,444
11년 전 조회 3,074
11년 전 조회 2,373
11년 전 조회 5,251
11년 전 조회 4,874
11년 전 조회 2,632
11년 전 조회 3,861
11년 전 조회 2,301
11년 전 조회 3,065
11년 전 조회 4,699
11년 전 조회 5,017
11년 전 조회 5,927
11년 전 조회 2,296
11년 전 조회 2,861
11년 전 조회 4,293
11년 전 조회 2,475
11년 전 조회 2,467
11년 전 조회 3,050
11년 전 조회 2,338
11년 전 조회 3,595
11년 전 조회 3,110
11년 전 조회 5,195
11년 전 조회 3,622
11년 전 조회 5,893
11년 전 조회 2,709
11년 전 조회 2,535
11년 전 조회 3,210