Jump to content
php.lv forumi

Taimaouts


kalabox

Recommended Posts

Sveiki, lūk kods.

 

<style>
 .black_overlay{
  display: none;
  position: absolute;
  top: 0%;
  left: 0%;
  width: 100%;
  height: 400%;
  background-color: black;
  z-index:1001;
  -moz-opacity: 0.8;
  opacity:.80;
  filter: alpha(opacity=80);
 }
 .white_content {
  display: none;
  position: absolute;
  top: 50%;
  left: 25%;
  width: 40%;
  height: 40%;
  padding: 16px;
  border: 16px solid orange;
  background-color: white;
  z-index:1002;
  overflow: auto;
 }
</style>
</head>
<body>
 <body  onload="document.getElementById('light').style.display='block';document.getElementById('fade').style.display='block'"></p>
 <div id="light" class="white_content" style="display: none;"><a href="javascript:void(0)" onclick="document.getElementById('light').style.display='none';document.getElementById('fade').style.display='none'">Aizvērt</a><p>
Lapā ik pa brīdim notiek visādi remontdarbi. Ja kādreiz ienākot kaut kas īsti nenostrādā, nesatraucies, pēc brītiņa atkal visam jābūt kārtībā.</div>
 <div id="fade" class="black_overlay" style="display: none; "></div>

 

Gribēju pajautāt, vai ir iespējams izveidot logam taimautu, bez cookies. Ja vienu reizi logs jau ir parādījies, lai nākamo reizi parādās pēc kādām 6H, kaut arī lapa jau ir desmitiem reižu refrešota..

Ir iespējams to dabūt?

Link to comment
Share on other sites

var expDays = 1; // number of days the cookie should last
var page = "only-popup-once.html";
var windowprops = "width=300,height=200,location=no,toolbar=no,menubar=no,scrollbars=no,resizable=yes";
function GetCookie (name) {
 var arg = name + "=";
 var alen = arg.length;
 var clen = document.cookie.length;
 var i = 0;
 while (i < clen) {
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
return getCookieVal (j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0) break;
 }
 return null;
}
function SetCookie (name, value) {
 var argv = SetCookie.arguments;
 var argc = SetCookie.arguments.length;
 var expires = (argc > 2) ? argv[2] : null;
 var path = (argc > 3) ? argv[3] : null;
 var domain = (argc > 4) ? argv[4] : null;
 var secure = (argc > 5) ? argv[5] : false;
 document.cookie = name + "=" + escape (value) +
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
((path == null) ? "" : ("; path=" + path)) +
((domain == null) ? "" : ("; domain=" + domain)) +
((secure == true) ? "; secure" : "");
}
function DeleteCookie (name) {
 var exp = new Date();
 exp.setTime (exp.getTime() - 1);
 var cval = GetCookie (name);
 document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}
var exp = new Date();
exp.setTime(exp.getTime() + (expDays*24*60*60*1000));
function amt(){
 var count = GetCookie('count')
 if(count == null) {
SetCookie('count','1')
return 1
 } else {
var newcount = parseInt(count) + 1;
DeleteCookie('count')
SetCookie('count',newcount,exp)
return count
 }
}
function getCookieVal(offset) {
 var endstr = document.cookie.indexOf (";", offset);
 if (endstr == -1)
 endstr = document.cookie.length;
 return unescape(document.cookie.substring(offset, endstr));
}
function checkCount() {
 var count = GetCookie('count');
 if (count == null) {
count=1;
SetCookie('count', count, exp);
window.open(page, "", windowprops);
 } else {
count++;
SetCookie('count', count, exp);
 }
}
window.onload=checkCount;

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...