jQueryを利用せずJavaScriptで実装する方法はこちらの記事を参照してください。
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<script src="Scripts/jquery-3.4.1.min.js"></script>
<style>
<!--
body {
padding:0 0 0 0;
margin:0 0 0 0;
}
.section{
height:480px;
border:1px solid #ff6a00;
width:70%;
}
.PopupButton{
text-align:center;
color:#FFFFFF;
display: table-cell;
vertical-align: middle;
width:160px;
height:48px;
background-color:#2673eb;
border-radius: 25px 25px 25px 25px / 25px 25px 25px 25px;
cursor:pointer;
}
.popup_section{
margin:0 0 0 0;
padding:0 0 0 0;
position: absolute;;
background-color:#2673eb;
color:#FFFFFF;
width:100%;
min-height:800px;
height:100%;
}
-->
</style>
<script type="text/javascript">
var scval;
$(document).ready(function () {
$('.popup_section').hide();
$('#PopupButton1').on('click', function () {
scval = $(window).scrollTop();
$('#popup_section1').show();
$('#page').hide();
$('body, html').scrollTop(0);
});
$('#PopupClose').on('click', function () {
$('#popup_section1').hide();
$('#page').show();
$(window).scrollTop(scval);
});
})
</script>
</head>
<body>
<div id="page">
<div class="section">section1</div>
<div class="section">section2</div>
<div class="section">section3</div>
<div class="section">section4</div>
<div class="section">section5</div>
<div class="section">
section6
<div id="PopupButton1" class="PopupButton">Button</div>
</div>
<div class="section">section7</div>
<div class="section">section8</div>
<div class="section">section9</div>
<div class="section">section10</div>
<div class="section">section11</div>
<div class="section">section12</div>
</div>
<div class="popup_section" id="popup_section1">
popup section1<br/>
<a id="PopupClose" href="javascript:void(0);">閉じる</a>
</div>
</body>
</html>
$('#PopupButton1').on('click', function () {
scval = $(window).scrollTop();
$('#popup_section1').show();
$('#page').hide();
$('body, html').scrollTop(0);
});
$('#PopupClose').on('click', function () {
$('#popup_section1').hide();
$('#page').show();
$(window).scrollTop(scval);
});
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<script src="Scripts/jquery-3.4.1.min.js"></script>
<style>
<!--
body {
padding:0 0 0 0;
margin:0 0 0 0;
}
.section{
height:480px;
border:1px solid #ff6a00;
width:70%;
}
.PopupButton{
text-align:center;
color:#FFFFFF;
display: table-cell;
vertical-align: middle;
width:160px;
height:48px;
background-color:#2673eb;
border-radius: 25px 25px 25px 25px / 25px 25px 25px 25px;
cursor:pointer;
}
.popup_section{
margin:0 0 0 0;
padding:0 0 0 0;
position: absolute;;
background-color:#2673eb;
color:#FFFFFF;
width:100%;
min-height:800px;
height:100%;
opacity:0;
transition-duration: .5s;
transform: translateY(5rem);
}
.popup_section.open{
opacity:1;
transform: translateY(0rem);
}
-->
</style>
<script type="text/javascript">
var scval;
$(document).ready(function () {
$('.popup_section').hide();
$('#PopupButton1').on('click', function () {
scval = $(window).scrollTop();
$('#popup_section1').show();
$('#popup_section1').addClass('open');
$('#page').hide();
$('body, html').scrollTop(0);
});
$('#PopupClose').on('click', function () {
$('#popup_section1').hide();
$('#popup_section1').removeClass('open');
$('#page').show();
$(window).scrollTop(scval);
});
})
</script>
</head>
<body>
<div id="page">
<div class="section">section1</div>
<div class="section">section2</div>
<div class="section">section3</div>
<div class="section">section4</div>
<div class="section">section5</div>
<div class="section">
section6
<div id="PopupButton1" class="PopupButton">Button</div>
</div>
<div class="section">section7</div>
<div class="section">section8</div>
<div class="section">section9</div>
<div class="section">section10</div>
<div class="section">section11</div>
<div class="section">section12</div>
</div>
<div class="popup_section" id="popup_section1">
popup section1<br/>
<a id="PopupClose" href="javascript:void(0);">閉じる</a>
</div>
</body>
</html>
$('#PopupButton1').on('click', function () {
scval = $(window).scrollTop();
$('#popup_section1').show();
$('#popup_section1').addClass('open');
$('#page').hide();
$('body, html').scrollTop(0);
});
.popup_section{
margin:0 0 0 0;
padding:0 0 0 0;
position: absolute;;
background-color:#2673eb;
color:#FFFFFF;
width:100%;
min-height:800px;
height:100%;
opacity:0;
transition-duration: .5s;
transform: translateY(5rem);
}
.popup_section.open{
opacity:1;
transform: translateY(0rem);
}
$('#PopupClose').on('click', function () {
$('#popup_section1').hide();
$('#popup_section1').removeClass('open');
$('#page').show();
$(window).scrollTop(scval);
});