JavaScript 브라우저 중앙에 띄우는 모달 팝업 (레이어 윈도우)
페이지 정보
첨부파일
-
modalpopup.zip (8.8K)
81회 다운로드 | DATE : 2022-06-13 22:38:10
본문
샘플 : https://www.happyjung.com/demo/js/needpopup.html
needpopup.css
needpopup.html
needpopup.js
needpopup.min.css
needpopup.min.js
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>needPopup demo</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../dist/needpopup.min.css">
<!-- Styles just for demo -->
<style>
body {
font: 14px/1 "Helvetica Neue",Helvetica,Arial,sans-serif;
margin:0;
padding:0;
background: #FFE;
}
.wrapper {
padding: 40px 60px;
}
a[data-needpopup-show] {
display: inline-block;
margin: 0 10px 10px 0;
padding: 10px 15px;
font-weight: bold;
letter-spacing: 1px;
text-decoration: none;
color: #fff;
background: #7B5207;
border-radius: 3px;
box-shadow: 0 1px 1px 1px rgba(0, 0, 0, 0.2);
}
p {
font-size: 1.2em;
line-height: 1.4;
color: #343638;
margin: 20px 0;
}
.needpopup {
border-radius: 6px;
box-shadow: 0 1px 5px 1px rgba(0, 0, 0, 1);
}
.needpopup p {
margin: 0;
}
.needpopup p + p {
margin-top: 10px;
}
</style>
</head>
<body>
<div class="wrapper">
<a href="#" data-needpopup-show="#small-popup">Show small popup</a>
<a href="#" data-needpopup-show="#big-popup">Show big popup</a>
<a href="#" data-needpopup-show="#custom-popup">Show custom options popup</a>
<div id='small-popup' class="needpopup">
<a href="#" data-needpopup-show="#big-popup">Go to big popup</a>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p>
</div>
<div id='custom-popup' class="needpopup" data-needpopup-options="custom">
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p>
</div>
<div id='big-popup' class="needpopup">
<a href="#" data-needpopup-show="#small-popup">Go to small popup</a>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
</div>
</div>
<script src="https://code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="../dist/needpopup.min.js"></script>
<script>
needPopup.config.custom = {
'removerPlace': 'outside',
'closeOnOutside': false,
onShow: function() {
console.log('needPopup is shown');
},
onHide: function() {
console.log('needPopup is hidden');
}
};
needPopup.init();
</script>
</body>
</html>
자료출처
http://www.blueb.co.kr/?c=1/15&cat=레이어윈도우&uid=3961
needpopup.css
needpopup.html
needpopup.js
needpopup.min.css
needpopup.min.js
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>needPopup demo</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../dist/needpopup.min.css">
<!-- Styles just for demo -->
<style>
body {
font: 14px/1 "Helvetica Neue",Helvetica,Arial,sans-serif;
margin:0;
padding:0;
background: #FFE;
}
.wrapper {
padding: 40px 60px;
}
a[data-needpopup-show] {
display: inline-block;
margin: 0 10px 10px 0;
padding: 10px 15px;
font-weight: bold;
letter-spacing: 1px;
text-decoration: none;
color: #fff;
background: #7B5207;
border-radius: 3px;
box-shadow: 0 1px 1px 1px rgba(0, 0, 0, 0.2);
}
p {
font-size: 1.2em;
line-height: 1.4;
color: #343638;
margin: 20px 0;
}
.needpopup {
border-radius: 6px;
box-shadow: 0 1px 5px 1px rgba(0, 0, 0, 1);
}
.needpopup p {
margin: 0;
}
.needpopup p + p {
margin-top: 10px;
}
</style>
</head>
<body>
<div class="wrapper">
<a href="#" data-needpopup-show="#small-popup">Show small popup</a>
<a href="#" data-needpopup-show="#big-popup">Show big popup</a>
<a href="#" data-needpopup-show="#custom-popup">Show custom options popup</a>
<div id='small-popup' class="needpopup">
<a href="#" data-needpopup-show="#big-popup">Go to big popup</a>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p>
</div>
<div id='custom-popup' class="needpopup" data-needpopup-options="custom">
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p>
</div>
<div id='big-popup' class="needpopup">
<a href="#" data-needpopup-show="#small-popup">Go to small popup</a>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
</div>
</div>
<script src="https://code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="../dist/needpopup.min.js"></script>
<script>
needPopup.config.custom = {
'removerPlace': 'outside',
'closeOnOutside': false,
onShow: function() {
console.log('needPopup is shown');
},
onHide: function() {
console.log('needPopup is hidden');
}
};
needPopup.init();
</script>
</body>
</html>
자료출처
http://www.blueb.co.kr/?c=1/15&cat=레이어윈도우&uid=3961
댓글목록
등록된 댓글이 없습니다.