웹디자인실기: 레이어 팝업창
레이어 팝업창 만들기
html
<!-- 모달창 시작 -->
<div id="modal">
<div class="modal_up">
    <div class="uptitle">신규회원 대상 이벤트 안내</div>
    <div class="upbody">즐거운 쇼핑 환경을 위해 항상 노력하는 ON쇼핑몰입니다.  
        고객님들께 한 단계 더 나아가 보답하는 ON쇼핑몰이 되고자
        신규회원 대상 10% 할인 이벤트를 실시하고 있습니다.
        웹과 모바일에서 모두 이용 가능하며, 
        수준 높은 서비스를 위해 앞으로도 꾸준히 노력할 것을 약속드립니다. 
        </div>
    <div class="btn">닫기</div>
</div>
</div>
<!-- 모달창 끝 -->
css
#modal{
    width: 100%;
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
    background: rgba(0,0,0,0.6);
    z-index: 1;
    display: none;
}
#modal.active{
    display: block;
}
.modal_up{
    width: 500px;
    height: 400px;
    position: fixed;
    left: 40%;
    top: 30%;
    border: 3px solid;
    border-color: #531742;
    background-color: #ffffff;
}
.uptitle{
    margin-top: 30px;
    text-align: center;
    line-height: 16px;
    font-size: 20px;
    font-weight: bold;
}
.upbody{
    padding: 30px;
    text-align: center;
    font-size: 16px;
    line-height: 30px;
}
.btn{
    height: 20px;
    width: 80px;
    cursor: pointer;
    display: block;
    text-align: center;
    font-size: 15px;
    font-weight: bold;
    color: #ffffff;
    border-radius: 3px;
    background-color: #531742;
    position: absolute;
    right: 10px;
    bottom: 10px;
}
javascript
    $(".notice li:first").click(function(){
        $("#modal").addClass("active")
    });
    $(".btn").click(function(){
        $("#modal").removeClass("active")
    });
                
                    
        
    
    
    
    
    
                
                
                
                
                    
                        
                            
                            
                            Author And Source
                            
                            이 문제에 관하여(웹디자인실기: 레이어 팝업창), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
                                
                                https://velog.io/@im-shung/웹디자인실기-레이어-팝업창
                            
                            
                            
                                저자 귀속: 원작자 정보가 원작자 URL에 포함되어 있으며 저작권은 원작자 소유입니다.
                            
                            
                                
                                
                                
                                
                                
                                우수한 개발자 콘텐츠 발견에 전념
                                (Collection and Share based on the CC Protocol.)
                            
                            
                        
                    
                
                
                
            
<!-- 모달창 시작 -->
<div id="modal">
<div class="modal_up">
    <div class="uptitle">신규회원 대상 이벤트 안내</div>
    <div class="upbody">즐거운 쇼핑 환경을 위해 항상 노력하는 ON쇼핑몰입니다.  
        고객님들께 한 단계 더 나아가 보답하는 ON쇼핑몰이 되고자
        신규회원 대상 10% 할인 이벤트를 실시하고 있습니다.
        웹과 모바일에서 모두 이용 가능하며, 
        수준 높은 서비스를 위해 앞으로도 꾸준히 노력할 것을 약속드립니다. 
        </div>
    <div class="btn">닫기</div>
</div>
</div>
<!-- 모달창 끝 -->#modal{
    width: 100%;
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
    background: rgba(0,0,0,0.6);
    z-index: 1;
    display: none;
}
#modal.active{
    display: block;
}
.modal_up{
    width: 500px;
    height: 400px;
    position: fixed;
    left: 40%;
    top: 30%;
    border: 3px solid;
    border-color: #531742;
    background-color: #ffffff;
}
.uptitle{
    margin-top: 30px;
    text-align: center;
    line-height: 16px;
    font-size: 20px;
    font-weight: bold;
}
.upbody{
    padding: 30px;
    text-align: center;
    font-size: 16px;
    line-height: 30px;
}
.btn{
    height: 20px;
    width: 80px;
    cursor: pointer;
    display: block;
    text-align: center;
    font-size: 15px;
    font-weight: bold;
    color: #ffffff;
    border-radius: 3px;
    background-color: #531742;
    position: absolute;
    right: 10px;
    bottom: 10px;
}    $(".notice li:first").click(function(){
        $("#modal").addClass("active")
    });
    $(".btn").click(function(){
        $("#modal").removeClass("active")
    });Author And Source
이 문제에 관하여(웹디자인실기: 레이어 팝업창), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://velog.io/@im-shung/웹디자인실기-레이어-팝업창저자 귀속: 원작자 정보가 원작자 URL에 포함되어 있으며 저작권은 원작자 소유입니다.
                                
                                
                                
                                
                                
                                우수한 개발자 콘텐츠 발견에 전념
                                (Collection and Share based on the CC Protocol.)