티스토리 뷰

WEB/JQuery

일정 높이 사이에 위치 시키기

silverline79 2021. 6. 29. 16:55

 

.smsSenBox > .rightPFixed { position:fixed !important; top: 20px !important; left: 50% !important; margin-left: 179px !important; }
.smsSenBox > .rightPAbsol { position:absolute; top: 700px; left: 50% !important; margin-left: 179px !important;  }

 

1
2
3
4
5
6
7
8
9
10
11
12
13
//위치 고정    
    $(window).scroll(function () {    
        if ($(this).scrollTop() < 320) {    
            $('.smsSenBox > .right').removeClass('rightPFixed');
            $('.smsSenBox > .right').removeClass('rightPAbsol');
        } else if ($(this).scrollTop() > 320 && $(this).scrollTop() < 650) {            
            $('.smsSenBox > .right').addClass('rightPFixed');
            $('.smsSenBox > .right').removeClass('rightPAbsol');
        } else if ( $(this).scrollTop() > 650){
            $('.smsSenBox > .right').removeClass('rightPFixed');
            $('.smsSenBox > .right').addClass('rightPAbsol');
        }
    });
cs

'WEB > JQuery' 카테고리의 다른 글

Date Range Picker  (0) 2021.08.19
jquery.scrollbar  (0) 2021.07.19
[jquery] Scrollbars  (0) 2021.06.29
jQuery.min.js 최신버전  (0) 2021.06.12
CSS 벤더프리픽스  (0) 2021.06.12
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/02   »
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28
글 보관함