Jump to content

Recommended Posts

всем привет, ну вообщем суть вопроса в следующем

установил всплывающее окно в это хедере, только при каждом обновлении страници и передоде по страницам оно выскакивает, как сделать что бы оно выскакивало один раз?

Share this post

Link to post
Share on other sites

по ссылке в коментах есть ссылка на это http://forum.vingrad.ru/forum/topic-326228/kw-cookie.html


<div id="parent_popup">

  <div id="popup">

<h1>«Уважаемые посетители»</h1>

<img src="http://dbmast.ru/wp-content/uploads/2012/11/DVD009.jpg" width="190" height="252" alt="Текст Текст Текст Текст Текст" style="float:left;margin:5px 10px 5px 0; border:0; " />

<h2>Текст Текст Текст Текст Текст,</p>

<p>Текст Текст Текст Текст Текст</p></h2>

<p><h2> Текст Текст Текст Текст Текст</h2></p>


<p style="text-align: center;"><strong><a class="button" href="ссылка</p>   

<a class="close" title="Закрыть" onclick="document.getElementById('parent_popup').style.display='none';">X</a>



<script type="text/javascript">

    var delay_popup = 1000;

    setTimeout("document.getElementById('parent_popup').style.display='block'", delay_popup);




var cookieName = 'check';

var cookieValue = 'true';

var сookieExist = 1000*60; // кука на одну минуту

var checkCookie = document.cookie;

if(checkCookie.indexOf(cookieName)==-1) {

    alert('no cookie');

    var exp = new Date();

    exp.setTime(exp.getTime() + сookieExist);

    document.cookie = cookieName + "=" + cookieValue + "; expires=" + exp.toGMTString();


else {

    alert('cookie is "' + checkCookie + '"');




не пойму это должно так быть?

Share this post

Link to post
Share on other sites


Share this post

Link to post
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.

You are posting as a guest. If you have an account, please sign in.
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.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.


Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.