Javascript 弹出一次会话时间
我的弹出窗口工作得很好,但我需要在会话中显示一次弹出窗口 我读过一些文档,但我不明白如何在代码中集成 我该怎么做 代码如下: HTMLJavascript 弹出一次会话时间,javascript,html,session,popup,Javascript,Html,Session,Popup,我的弹出窗口工作得很好,但我需要在会话中显示一次弹出窗口 我读过一些文档,但我不明白如何在代码中集成 我该怎么做 代码如下: HTML 喀布尔埃迪约鲁姆。 JS $(文档).ready(函数(){ 变量id='#对话框'; //获取屏幕的高度和宽度 var maskHeight=$(document.height(); var maskWidth=$(window.width(); //设置遮罩的高度和宽度以填充整个屏幕 $(#mask').css({“宽度”:maskWidth,“高
喀布尔埃迪约鲁姆。
JS
$(文档).ready(函数(){
变量id='#对话框';
//获取屏幕的高度和宽度
var maskHeight=$(document.height();
var maskWidth=$(window.width();
//设置遮罩的高度和宽度以填充整个屏幕
$(#mask').css({“宽度”:maskWidth,“高度”:maskHeight});
//过渡效应
$('面具').fadeIn(300);
$(#mask').fadeTo(“慢”,0.9);
//获取窗口的高度和宽度
var winH=$(window.height();
var winW=$(window.width();
//将弹出窗口设置为居中
$(id).css('top',winH/2-$(id).height()/2);
$(id).css('left',winW/2-$(id).width()/2);
//过渡效应
美元(id).fadeIn(1000);
//如果单击“关闭”按钮
$('.window.close')。单击(函数(e){
//取消链接行为
e、 预防默认值();
$(“#掩码”).hide();
$('.window').hide();
});
//如果单击了“遮罩”
$(“#掩码”)。单击(函数(){
$(this.hide();
$('.window').hide();
});
});
非常感谢
<div id="boxes">
<div id="dialog" class="window">
<header> <a href="#" class="js-modal-close close">×</a>
</header>
<a href="#" class="js-modal-close close">×</a>
<div class="subscribeform">
<div class="form-group">
<asp:TextBox ID="txtname" CssClass="form-control2" placeholder="Name" runat="server"></asp:TextBox>
</div>
<div class="form-group">
<asp:TextBox ID="txtsurname" CssClass="form-control2" placeholder="Surname" runat="server"></asp:TextBox>
</div>
<div class="form-group">
<asp:TextBox ID="txtemail" CssClass="form-control2" placeholder="Email"
runat="server"></asp:TextBox>
</div>
<div class="checkbox">
<label class="uyeliksartlari">
<input type="checkbox">
Üyelik Şartlarını Kabul Ediyorum.
</label>
</div>
<asp:Button ID="btngonder" runat="server" CssClass="btn btn-default" Text="Gönder"
OnClick="btngonder_Click" />
</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(300);
$('#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(1000);
//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();
});
});