2015-01-25 2 views
0

내 웹 사이트에 작동하지만 한 번만 2-3시간 당 표시 할 원하는 : - https://www.helpingtechie.com표시 대화 상자는 한 번에 3 시간마다

이 없습니다 내 코드는 준 웹 사이트에서 다운로드 할 수 있습니다.

쿠키를 추가해야한다고 생각합니다. 사용

코드 : -

.guestwarn-mask{ 
 
\t position:absolute; 
 
\t background:#fff; 
 
\t opacity:0.5; 
 
\t filter:alpha(opacity=50); 
 
\t z-index: 4; 
 
\t overflow: hidden; 
 
} 
 
.guestwarn-layout{ 
 
\t -moz-transform: scale(0); 
 
\t -webkit-transform: scale(0); 
 
\t -ms-transform: scale(0); 
 
\t -o-transform: scale(0); 
 
\t transform: scale(0); 
 
\t -webkit-transition: all 500ms cubic-bezier(0.39, 1.42, 0.48, 1) 250ms; 
 
\t -moz-transition: all 500ms cubic-bezier(0.39, 1.42, 0.48, 1) 250ms; 
 
\t -ms-transition: all 500ms cubic-bezier(0.39, 1.42, 0.48, 1) 250ms; 
 
\t -o-transition: all 500ms cubic-bezier(0.39, 1.42, 0.48, 1) 250ms; 
 
\t transition: all 500ms cubic-bezier(0.39, 1.42, 0.48, 1) 250ms; 
 
\t position:absolute; 
 
\t border:1px solid #eee; 
 
\t background:#fff; 
 
\t box-shadow: 1px 2px 4px rgba(100,100,100,0.1); 
 
\t display:none; 
 
\t z-index:5; 
 
} 
 
.guestwarn-layout-animate{ 
 
\t -moz-transform: scale(1); 
 
\t -webkit-transform: scale(1); 
 
\t -ms-transform: scale(1); 
 
\t -o-transform: scale(1); 
 
\t transform: scale(1); 
 
} 
 
.guestwarn-layout-close{ 
 
\t -webkit-transition: all 900ms cubic-bezier(.37,-0.99,.24,.24) 100ms; 
 
\t -moz-transition: all 900ms cubic-bezier(.37,-0.99,.24,.24) 100ms; 
 
\t -ms-transition: all 900ms cubic-bezier(.37,-0.99,.24,.24) 100ms; 
 
\t -o-transition: all 900ms cubic-bezier(.37,-0.99,.24,.24) 100ms; 
 
\t transition: all 900ms cubic-bezier(.37,-0.99,.24,.24) 100ms; 
 
\t top:-300px !important; 
 
} 
 
.guestwarn-content{ 
 
\t position:relative; 
 
\t color:#555; 
 
\t overflow:hidden; 
 
} 
 
.guestwarn-title{ 
 
\t position:absolute; 
 
\t left:0px; 
 
\t top:0px; 
 
\t height:40px; 
 
\t width:100%; 
 
\t overflow:hidden; 
 
\t background:#eee; 
 
\t font:normal 16px Microsoft Yahei; 
 
\t color:#fff 
 
} 
 
.guestwarn-title span{ 
 
\t display:block; 
 
\t float:left; 
 
\t padding:10px 20px; 
 
\t background:#08c; 
 
} 
 
.guestwarn-close{ 
 
\t position:absolute; 
 
\t right:0px; 
 
\t top:0px; 
 
\t background:#E04343; 
 
\t display:block; 
 
\t text-decoration:none; 
 
\t font-family:Tahoma; 
 
\t font-size:20px; 
 
\t line-height:37px; 
 
\t height:40px; 
 
\t width:40px; 
 
\t text-align:center; 
 
\t color:#fff 
 
} 
 
.guestwarn-close:hover{ 
 
\t opacity:0.8; 
 
\t filter:alpha(opacity=80); 
 
\t } 
 
.guestwarn-html{ 
 
\t padding:50px 20px 20px 20px; 
 
\t font:normal 16px Microsoft Yahei; 
 
\t line-height: 150%; 
 
\t text-align:left; 
 
} 
 
.guestwarn-html a{ 
 
\t color:#58f 
 
}
<script src="https://www.helpingtechie.com/jscripts/jquery.guestwarn.js"></script> 
 
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"> 
 
</script> 
 

 
<script> 
 
$(function(){ 
 
\t $.guestwarn({ 
 
\t \t mask:true, 
 
\t \t height: 'auto', 
 
\t \t title:'Dear Guest', 
 
\t \t html:'If you read this, it means you are not registered. <br><a href="/member.php?action=register" target="_blank">Click here</a> to register in a few simple steps, you will enjoy all features of our Forum.', 
 
\t \t callback:function(){ 
 
\t \t \t console.log('CALLBACKS') 
 
\t \t } 
 
\t }); 
 
}); 
 
</script>

+0

좋은 질문을? 너는 무엇을 묻고 자 하는가? –

답변

0

내가 당신의 "질문에"이해하면 corectly ...이 도움이 될 수 있습니다

$(function(){ 
    setInterval(function() { 
     $.guestwarn({ 
      mask:true, 
      height: 'auto', 
      title:'Dear Guest', 
      html:'If you read this, it means you are not registered. <br><a href="/member.php?action=register" target="_blank">Click here</a> to register in a few simple steps, you will enjoy all features of our Forum.', 
      callback:function(){ 
       console.log('CALLBACKS') 
      } 
     }); 
    }, 10800000); 
// 10800000 is 3 hours in miliseconds 
}); 
+0

setInterval은 3 시간마다 guestwarn을 수행합니다 ... 그리고 손님이 3 시간 후에 한 번만 경고해야하는 경우 setTimeout을 사용하십시오. – hlozancic

관련 문제