<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
May also need to include jquery, not sure
<style>
#mask {
position: absolute;
left: 0;
top: 0;
z-index: 9000;
background-color: #000;
display: none;
}
#boxes .window {
position: absolute;
left: 0;
top: 0;
width: 440px;
height: 200px;
display: none;
z-index: 9999;
padding: 20px;
border-radius: 15px;
text-align: center;
}
#boxes #dialog {
width: 720px;
height: 320px;
padding: 10px;
background-color: #ffffff;
font-family: Helvetica, 'Segoe UI Light', sans-serif;
font-size: 15pt;
}
#popupfoot {
font-size: 11pt;
position: absolute;
bottom: 0px;
width: 250px;
left: 250px;
padding-bottom:5px;
}
</style> |
<style>
#mask {
position: absolute;
left: 0;
top: 0;
z-index: 9000;
background-color: #000;
display: none;
}
#boxes .window {
position: absolute;
left: 0;
top: 0;
width: 440px;
height: 200px;
display: none;
z-index: 9999;
padding: 20px;
border-radius: 15px;
text-align: center;
}
#boxes #dialog {
width: 720px;
height: 320px;
padding: 10px;
background-color: #ffffff;
font-family: Helvetica, 'Segoe UI Light', sans-serif;
font-size: 15pt;
}
#popupfoot {
font-size: 11pt;
position: absolute;
bottom: 0px;
width: 250px;
left: 250px;
padding-bottom:5px;
}
</style>
<div id="boxes">
<div id="dialog" class="window">
<a href="#" target="_blank"><img src="http://placehold.it/720x300"></a>
<div id="popupfoot"><a href="#" class="close agree">Close</a></div>
</div>
<div id="mask"></div>
</div> |
<div id="boxes">
<div id="dialog" class="window">
<a href="#" target="_blank"><img src="http://placehold.it/720x300"></a>
<div id="popupfoot"><a href="#" class="close agree">Close</a></div>
</div>
<div id="mask"></div>
</div>
<script>
$(document).ready(function() {
var id = '#dialog';
//Get the screen height and width
var maskHeight = $(document).height();
var maskWidth = $(window).width();
//Set heigth and width to mask to fill up the whole screen
$('#mask').css({'width':maskWidth,'height':maskHeight});
//transition effect
$('#mask').fadeIn(500);
$('#mask').fadeTo("slow",0.9);
//Get the window height and width
var winH = $(window).height();
var winW = $(window).width();
//Set the popup window to center
$(id).css('top', winH/2-$(id).height()/2);
$(id).css('left', winW/2-$(id).width()/2);
//transition effect
$(id).fadeIn(2000);
//if close button is clicked
$('.window .close').click(function (e) {
//Cancel the link behavior
e.preventDefault();
$('#mask').hide();
$('.window').hide();
});
//if mask is clicked
$('#mask').click(function () {
$(this).hide();
$('.window').hide();
});
});
</script> |
<script>
$(document).ready(function() {
var id = '#dialog';
//Get the screen height and width
var maskHeight = $(document).height();
var maskWidth = $(window).width();
//Set heigth and width to mask to fill up the whole screen
$('#mask').css({'width':maskWidth,'height':maskHeight});
//transition effect
$('#mask').fadeIn(500);
$('#mask').fadeTo("slow",0.9);
//Get the window height and width
var winH = $(window).height();
var winW = $(window).width();
//Set the popup window to center
$(id).css('top', winH/2-$(id).height()/2);
$(id).css('left', winW/2-$(id).width()/2);
//transition effect
$(id).fadeIn(2000);
//if close button is clicked
$('.window .close').click(function (e) {
//Cancel the link behavior
e.preventDefault();
$('#mask').hide();
$('.window').hide();
});
//if mask is clicked
$('#mask').click(function () {
$(this).hide();
$('.window').hide();
});
});
</script>
Recent Comments