Site introduction layer (float div) [closed]

0

I need to find a solution where you open a layer to place advertising that closes automatically if you do not do anything.

Is there any script you can recommend?

Can you help me with this question?

    
asked by anonymous 10.12.2014 / 10:08

1 answer

1

You can use the setTimeout function. Here's an example:

jQuery(function(){
  
  var itv = window.setTimeout(function(){
    
    jQuery("div.publicidade").fadeOut("fast", function(){ //ocultando a div da pagina com um efeito de fade
      jQuery("div.publicidade").remove(); //eliminando a div
      window.clearInterval(itv);
    });
    
  }, 3000); // delay de 3 segundos para executar a ação
  
});
div.publicidade{position:absolute; width: 200px; height: 200px; background: #efefef; border: 1px solid #ccc; top:100px; left: 100px;}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script><divclass="publicidade"></div>
    
10.12.2014 / 10:37