如何在每个用户或每次访问时只显示一次pop? [英] How to show pop only once per user or per visit?

查看:93
本文介绍了如何在每个用户或每次访问时只显示一次pop?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在索引页的页面加载时使用jquery pop



code

Hi,
I am using a jquery pop on page load of index page

code

<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.session.js"></script>
<script type="text/javascript" src="js/jquery.cookie.js"></script>
<script type="text/javascript">
$(document).ready(function() {	
	
$.cookie('the_cookie', 'the_value');// error $.cookie not a function
alert($.cookie('the_cookie'));
or
$.session('the_cookie', 'the_value');// error $.session not a function
alert($.session('the_cookie'));             

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(1000);	
		$('#mask').fadeTo("slow",0.8);	
	
		//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>





对话框代码。



dialogue box code.

<html>
<div display: none;" id="dialog" class="window">
<table width="200" border="0" cellspacing="0">
<form style="display:inline;" action="" method="post" name="enquiry_frm" accept-charset="UTF-8" >
<tr>
<td style="padding-removed10px;">
<input name="fldname" id="fldname" type="text"  class="newsbox" onclick="setLFBlanks(this);" value="Name" style="width:130px;" /></td>
<td>
<input name="fldEmail" id="fldEmail1" type="text"  class="newsbox" onclick="setLFBlanks(this);" value="Email Address" style="width:130px;" />
</td>
</tr></table></div></html>





我打开这个在索引/主页的页面加载每次但我想如果用户填写框或取消它然后它不应该整天或特定时间段再次打开。



这可以通过会话或任何其他方法实现。

如果您有任何意识到这一点,请回复我的解决方案



谢谢



I am opening this on page load of index/home page every time but i want that if a user fill the box or cancel it then it should not be open again whole day or a particular period of time.

this could be possible through session or any other method.
If any of you aware of this please revert me back with the solution

Thanks

推荐答案

document )。ready( function (){
(document).ready(function() {


.cookie(' the_cookie '' the_value'); // 错误
.cookie('the_cookie', 'the_value');// error


.cookie不是函数
alert(
.cookie not a function alert(


这篇关于如何在每个用户或每次访问时只显示一次pop?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆