레이어팝업 질문이요ㅠㅠ

레이어팝업 질문이요ㅠㅠ

QA

레이어팝업 질문이요ㅠㅠ

본문

레이어팝업을 클릭안하고 특정 게시판 페이지 열리면 바로 뜨게하고싶은데

어떻게 수정하면될까여ㅜㅜ 도움좀 주세여..ㅜㅜ

 

 


    <div style="height: 300px;"></div>
    <a href="#layer1" class="btn-example">일반 팝업레이어</a>
    <div id="layer1" class="pop-layer">
        <div class="pop-container">
            <div class="pop-conts">
                <!--content //-->
                <p class="ctxt mb20">Thank you.<br>
                    Your registration was submitted successfully.<br>
                    Selected invitees will be notified by e-mail on JANUARY 24th.<br><br>
                    Hope to see you soon!
                </p>
    
                <div class="btn-r">
                    <a href="#" class="btn-layerClose">Close</a>
                </div>
                <!--// content-->
            </div>
        </div>
    </div>

 
<script>
$('.btn-example').load(function(){
        var $href = $(this).attr('href');
        layer_popup($href);
    });
    function layer_popup(el){
 
        var $el = $(el);        //레이어의 id를 $el 변수에 저장
        var isDim = $el.prev().hasClass('dimBg');   //dimmed 레이어를 감지하기 위한 boolean 변수
 
        isDim ? $('.dim-layer').fadeIn() : $el.fadeIn();
 
        var $elWidth = ~~($el.outerWidth()),
            $elHeight = ~~($el.outerHeight()),
            docWidth = $(document).width(),
            docHeight = $(document).height();
 
        // 화면의 중앙에 레이어를 띄운다.
        if ($elHeight < docHeight || $elWidth < docWidth) {
            $el.css({
                marginTop: -$elHeight /2,
                marginLeft: -$elWidth/2
            })
        } else {
            $el.css({top: 0, left: 0});
        }
 
        $el.find('a.btn-layerClose').click(function(){
            isDim ? $('.dim-layer').fadeOut() : $el.fadeOut(); // 닫기 버튼을 클릭하면 레이어가 닫힌다.
            return false;
        });
 
        $('.layer .dimBg').click(function(){
            $('.dim-layer').fadeOut();
            return false;
        });
 
    }
 
</script>

이 질문에 댓글 쓰기 :

답변 1

jquery 에서 document ready 쪽에 현재 페이지를 읽어내는 $_SERVER 로 변수 선언하고 원하시는 링크로 들어왔을때 혹은 indexOf 일때 실행시키도록 하면 될것같네요..ㅎ

답변을 작성하시기 전에 로그인 해주세요.
전체 123,524 | RSS
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT