[jquery]layer popup

2014. 2. 19. 16:37ยทLanguages/JavaScript
@charset "utf-8";

@font-face {
	font-family: ngttf;
	src: url(NanumGothic.ttf);
}

@font-face {
	font-family: ngeot;
	src: url(NanumGothic.eot);
}

* {
	margin: 0;
	padding: 0;
	font-family: ngeot, ngttf, Nanumgothic;
}

html,
body {
	_height: 100%;
	font-family: ngttf, ngeot;
}

img,
fieldset {
	border: 0;
}

form,
fieldset {
	margin: 0;
	padding: 0;
}

em,
address {
	font-style: normal;
}

button {
	margin: 0;
	padding: 0;
	overflow: visible;
	cursor: pointer;
}

a {
	text-decoration: none;
}

a:hover,
a:active,
a:focus {
	text-decoration: underline;
}

table {
	table-layout: fixed;
	border-collapse: collapse;
}

/* Button Common */
.button,
.button * {
	position: relative;
	margin: 0;
	padding: 0;
	display: inline-block;
	text-decoration: none !important;
	border: 0;
	font-size: 12px;
	white-space: nowrap;
	background: url(button.gif) no-repeat;
	vertical-align: top;
	overflow: visible;
	color: #333;
}

.button {
	margin-right: 4px;
}

.button * {
	left: 4px;
	cursor: pointer;
	_cursor: hand;
}

.button.medium,
.button.medium * {
	height: 24px;
	line-height: 21px;
}

/* ๋ง‘์€๊ณ ๋”•์„ ์‚ฌ์šฉํ•  ๊ฒฝ์šฐ 21px, ๋‹์›€์„ ์‚ฌ์šฉํ•  ๊ฒฝ์šฐ 24px ์‚ฌ์šฉ */
.button.medium {
	background-position: left 0;
}

.button.medium * {
	padding: 0 10px 0 6px;
	font-size: 12px;
	background-position: right top;
}

/* Button Hover */
.button *:hover,
.button *:active,
.button *:focus {
	color: #06a;
}

/* Button Icon Variation */
.button.icon * {
	padding-left: 20px;
}

.button.icon span {
	width: 20px;
	margin-right: -20px;
	padding: 0 !important;
}

.button.medium .check {
	background-position: 4px -150px;
}

.button.medium .add {
	background-position: -16px -150px;
}

.button.medium .delete {
	background-position: -34px -150px;
}

.button.medium .calendar {
	background-position: -56px -150px;
}

.button.medium .refresh {
	background-position: -76px -150px;
}

.button.medium .download {
	background-position: -96px -151px;
}

/* Common Class */
.iText {
	border: 1px solid #b7b7b7;
	border-right-color: #e1e1e1;
	border-bottom-color: #e1e1e1;
	background: transparent;
}

.iCheck,
.iRadio {
	width: 13px;
	height: 13px;
	margin: 0;
	padding: 0;
	vertical-align: middle;
}

.hide {
	position: absolute;
	left: 0;
	top: 0;
	width: 1px;
	height: 1px;
	font-size: 0;
	line-height: 0;
	visibility: hidden;
}

/* Popup Layer */
.layer {
	display: none;
	position: fixed;
	_position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 10000;
}

.open {
	display: block;
}

.layer .bg {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: #000;
	opacity: .5;
	filter: alpha(opacity=50);
}

.layer_area {
	position: absolute;
	left: 50%;
	top: 50%;
	background: #fff;
	padding: 20px;
	border: 4px solid #ddd;
}
 jQuery(function($){ 	
 	function layer_open(el){ 		
    	//$('.layer').addClass('open'); 		
        $('.layer').fadeIn(); 		
        var temp = $('#' + el); 		
        if (temp.outerHeight() < $(document).height() ) temp.css('margin-top', '-'+temp.outerHeight()/2+'px'); 		
        else temp.css('top', '0px'); 		
        if (temp.outerWidth() < $(document).width() ) temp.css('margin-left', '-'+temp.outerWidth()/2+'px'); 		
        else temp.css('left', '0px'); 	
 	} 	
    $('#layer_open').click(function(){
    	layer_open('layer1'); /* ์—ด๊ณ ์ž ํ•˜๋Š” ๊ฒƒ์˜ ์•„์ด๋””๋ฅผ ์ž…๋ ฅ */
        return false;
    });
    $('.layer .bg').click(function(){
    	$('.layer').fadeOut();
    });
    $('#layer_close').click(function(){
    	$('.layer').fadeOut();
        return false;
    });
    $(document).ready(function(){ 	}); 
});

 

<div style="margin:30px;"><span class="button medium"><a href="#" id="layer_open">ํŒ์—…์ฐฝ ์—ด๊ธฐ</a></span></div>
<div class="layer">
   <div class="bg"></div>
   <div class="layer_area" id="layer1">
      <p style="width:400px; text-align:justify; font-family:Malgun gothic;">์ด ๊ฒƒ์€ ํŒ์—…์ฐฝ์ž…๋‹ˆ๋‹ค.</p>
      <br />             <span class="button medium"><a href="#" id="layer_close">ํŒ์—…์ฐฝ ๋‹ซ๊ธฐ</a></span>         
   </div>
</div>

 

 

์ถœ์ฒ˜ : http://blog.nettor.com/jquery_popup/popup.html

728x90
์ €์ž‘์žํ‘œ์‹œ ๋น„์˜๋ฆฌ ๋ณ€๊ฒฝ๊ธˆ์ง€ (์ƒˆ์ฐฝ์—ด๋ฆผ)
'Languages/JavaScript' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€
  • [jquery] ๋””๋ฐ”์ด์Šค ์ •๋ณด๋ฅผ ๊ธฐ์ค€์œผ๋กœ ํ•œ swipe
  • [javascript] select box์˜ value selected
  • [javascript]html5 video stop, reset, load
  • [javascript]์ฐจํŠธ ๊ด€๋ จ ์Šคํฌ๋ฆฝ
์ง€๋‹ˆ๐Ÿงž‍โ™‚๏ธ๐Ÿฅญ
์ง€๋‹ˆ๐Ÿงž‍โ™‚๏ธ๐Ÿฅญ
์ผ์ƒ, ๊ฒŒ์ž„, ๋ง›์ง‘, ์—ฌํ–‰, ๊ฐœ๋ฐœ, IT ๋ธ”๋กœ๊ทธ๐Ÿงž
  • ์ง€๋‹ˆ๐Ÿงž‍โ™‚๏ธ๐Ÿฅญ
    ์š”์ˆ  ๋žจํ”„๐Ÿซ–
    ์ง€๋‹ˆ๐Ÿงž‍โ™‚๏ธ๐Ÿฅญ
  • ์ „์ฒด
    ์˜ค๋Š˜
    ์–ด์ œ
    • All (549)
      • Languages (57)
        • JAVA (13)
        • JSP (1)
        • C_C++ (4)
        • Html (3)
        • CSS (1)
        • JavaScript (18)
        • Python (3)
        • Kotlin (13)
        • TypeScript (1)
      • Framework (14)
        • spring (11)
        • jstl (1)
        • angular (2)
      • Tool (28)
        • Eclipse (5)
        • vsCode (3)
        • scrcpy (2)
        • Git (1)
        • IntelliJ (6)
        • Visual-studio (1)
        • UML (1)
        • Gradle (8)
      • DB (6)
        • Oracle (1)
        • MySql (3)
        • Mongo (2)
      • OS (14)
        • Linux (2)
        • Windows (12)
      • Server (8)
        • Tomcat (1)
        • Apache (1)
        • Node.js (6)
      • Programmings (25)
        • Design Pattern (2)
        • Funny (20)
        • Algorithms (3)
      • Cloud (8)
        • Docker (1)
        • Kubernetes (4)
        • Istio (1)
        • ArgoCD (2)
      • IT (5)
        • gRPC (3)
        • RESTful (3)
        • Web UI (5)
        • AI (4)
      • Book (6)
      • TIP (187)
      • Life (53)
      • Game (83)
      • Storage (22)
      • ์‹๋‹น (15)
  • ๋ธ”๋กœ๊ทธ ๋ฉ”๋‰ด

    • ํ™ˆ
    • ํƒœ๊ทธ
    • ๋ฐฉ๋ช…๋ก
    • ์‚ฌ์ดํŠธ๋งต
    • RSS
    • ๊ธฐํƒ€ ์†Œ๋“
  • ๋งํฌ

    • ๊ตฌ๊ธ€
    • ๋„ค์ด๋ฒ„
    • ์ •๋ถ€24
    • Spring Framework ๋ฆด๋ฆฌ์ฆˆ ๋…ธํŠธ
    • Kotlin ๋ฆด๋ฆฌ์ฆˆ ๋…ธํŠธ
    • ์นด์นด์˜ค ์• ๋“œํ•
    • ๋ธ”๋กœ๊ทธ ์‚ฌ์ดํŠธ๋งต
    • ๋ธ”๋กœ๊ทธ RSS
  • ๊ณต์ง€์‚ฌํ•ญ

    • ์•ˆ๋…•ํ•˜์„ธ์š”
  • ์ธ๊ธฐ ๊ธ€

  • ํƒœ๊ทธ

    ๋‰ด์Šค ๋ธŒ๋ฆฌํ•‘
    ๋ฐ์ผ๋ฆฌ ๋‰ด์Šค
    ํƒœ๊ตญ
    ๋ชฌ์Šคํ„ฐํ—Œํ„ฐ์™€์ผ์ฆˆ
    ๋ชฌ์Šคํ„ฐํ—Œํ„ฐ๋‚˜์šฐ
    ๋ธŒ๋ฆฌํ•‘
    ์˜ค๋Š˜์˜๋‰ด์Šค
    ํ€˜์ŠคํŠธ
    ๋‰ด์Šค
    ํ•œ๋ˆˆ์— ๋ณด๋Š” ์˜ค๋Š˜์˜ ๋‰ด์Šค
  • ์ตœ๊ทผ ๋Œ“๊ธ€

  • ์ตœ๊ทผ ๊ธ€

  • hELLOยท Designed By์ •์ƒ์šฐ.v4.10.3
์ง€๋‹ˆ๐Ÿงž‍โ™‚๏ธ๐Ÿฅญ
[jquery]layer popup
์ƒ๋‹จ์œผ๋กœ

ํ‹ฐ์Šคํ† ๋ฆฌํˆด๋ฐ”