I want to show Pop up window in the front page before enter in to the website.Please help

Comments

d2ev’s picture

In the front page write your code for popup -

<div id="lightboxAutoModal" style="display: none;" rel="lightmodal[|width:480px; height:408px;]">
          <div class="lightbox-inner" style="display: inline";> Code for popup which contain a anchor tag <a id="skip" href="/">Skip This Ad »</a> 
          </div>
</div>

Manage the display of this popup using php cookie - i.e if cookie is not set then it will show the popup box

if (!isset($_COOKIE["welcomead"])) {
 //Your popup box code 
 <div id="lightboxAutoModal".........</div>
 //set a cookie "welcomead" 
 setcookie("welcomead","Ad Viewed", time()+3600, '/', 'example.com');
}

For skip the welcomead put this JavaScript -

<script type="text/javascript">
$(document).ready(function () {    
  $('#lightboxAutoModal').triggerHandler("click");
  $("#skip").click(function() {
  Lightbox.end('forceClose');
  });
});
</script> 
mladenu’s picture

Great solution but in my case with boost reproduce strange behavior when page is cached.. For non-authenticated user cookies is set but pop-up jump again and again.. Do you know where is a problem? To mention, i put php code in block.. Thanks in advance.