레이어팝업 질문이요ㅠㅠ 채택완료
냐이
5년 전
조회 3,499
레이어팝업을 클릭안하고 특정 게시판 페이지 열리면 바로 뜨게하고싶은데
어떻게 수정하면될까여ㅜㅜ 도움좀 주세여..ㅜㅜ
</p>
<p> <div style="height: 300px;"></div></p>
<p> <a href="#layer1" class="btn-example">일반 팝업레이어</a></p>
<p> <div id="layer1" class="pop-layer"></p>
<p> <div class="pop-container"></p>
<p> <div class="pop-conts"></p>
<p> <!--content //--></p>
<p> <p class="ctxt mb20">Thank you.
</p>
<p> Your registration was submitted successfully.
</p>
<p> Selected invitees will be notified by e-mail on JANUARY 24th.
</p>
<p> Hope to see you soon!</p>
<p> </p></p>
<p> </p>
<p> <div class="btn-r"></p>
<p> <a href="#" class="btn-layerClose">Close</a></p>
<p> </div></p>
<p> <!--// content--></p>
<p> </div></p>
<p> </div></p>
<p> </div></p>
<p>
</p>
<p><script></p>
<p>$('.btn-example').load(function(){</p>
<p> var $href = $(this).attr('href');</p>
<p> layer_popup($href);</p>
<p> });</p>
<p> function layer_popup(el){</p>
<p> </p>
<p> var $el = $(el); //레이어의 id를 $el 변수에 저장</p>
<p> var isDim = $el.prev().hasClass('dimBg'); //dimmed 레이어를 감지하기 위한 boolean 변수</p>
<p> </p>
<p> isDim ? $('.dim-layer').fadeIn() : $el.fadeIn();</p>
<p> </p>
<p> var $elWidth = ~~($el.outerWidth()),</p>
<p> $elHeight = ~~($el.outerHeight()),</p>
<p> docWidth = $(document).width(),</p>
<p> docHeight = $(document).height();</p>
<p> </p>
<p> // 화면의 중앙에 레이어를 띄운다.</p>
<p> if ($elHeight < docHeight || $elWidth < docWidth) {</p>
<p> $el.css({</p>
<p> marginTop: -$elHeight /2,</p>
<p> marginLeft: -$elWidth/2</p>
<p> })</p>
<p> } else {</p>
<p> $el.css({top: 0, left: 0});</p>
<p> }</p>
<p> </p>
<p> $el.find('a.btn-layerClose').click(function(){</p>
<p> isDim ? $('.dim-layer').fadeOut() : $el.fadeOut(); // 닫기 버튼을 클릭하면 레이어가 닫힌다.</p>
<p> return false;</p>
<p> });</p>
<p> </p>
<p> $('.layer .dimBg').click(function(){</p>
<p> $('.dim-layer').fadeOut();</p>
<p> return false;</p>
<p> });</p>
<p> </p>
<p> }</p>
<p> </p>
<p></script></p>
<p>
댓글을 작성하려면 로그인이 필요합니다.
답변 1개
답변을 작성하려면 로그인이 필요합니다.
로그인