Jump to content
Fórum Script Brasil
  • 0

Fechar Pop Up automaticamente após x segundos?


Bruna Marinho
 Share

Question

Olá para todos, sou nova aqui e estou prescisando de ajuda de vocês, meu amigo me deu um pop up personalisado (widget do facebook) que abre junto com meu blog (Blogger), e aparece uma vez só para a pessoa, mas gostaria que o pop up fechasse automaticamente após 5 segundos, sem que o visitante tenha que confirmar nada, já tentei muitos códigos, mas o mais perto que cheguei foi um código que fecha o pop up, mas fecha também minha página do blog junto, aí não adianta né... rsrs. Por favor me ajudem, não entendo desses códigos e estou a dias procurando... quase desistindo aff. Muito obrigado a todos.

Segue o cógio inteiro do meu pop up:

<script src='http://yourjavascript.com/01114252230/jquery-min.js'></script>
<script src="http://yourjavascript.com/18530532124/jquery-colorbox-min.js"></script>
<script type="text/javascript">
function createCookie(name,value,days) {
    if (days) {
        var date = new Date();
        date.setTime(date.getTime()+(days*2*60*60*1000));        
        var expires = "; expires="+date.toGMTString();
    }
    else var expires = "";
    document.cookie = name+"="+value+expires+"; path=/";
}
function readCookie(name) {
    var nameEQ = name + "=";
    var ca = document.cookie.split(';');
    for(var i=0;i < ca.length;i++) {
        var c = ca;
        while (c.charAt(0)==' ') c = c.substring(1,c.length);
        if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
    }
    return null;
}
function eraseCookie(name) {
    createCookie(name,"",-1);
}
jQuery(document).ready(function() {
    var visited = readCookie('visited');
    if (!visited || visited !== "true") {
        createCookie('visited', "true", 1);
        $.colorbox({width:"400px", inline:true, href:"#subscribe"});
    }
});
</script>
<script type="text/javascript" src="http://yourjavascript.com/14222701305/google-jquery-min.js"></script>
<script type="text/javascript">
// JavaScript Document
 var $q = jQuery.noConflict();
$q(document).ready(function()
{
$q("#lightbox, #lightboxContent").click(function(){
$q("#lightbox, #lightboxContent").hide();
})});
</script>
<style type="text/css">
#lightbox {
    background-color: #000;
    float: left;
    height: 100%;
    opacity: 0.9;
    -moz-opacity: 0.90;
    filter: alpha(opacity=90);
    position: fixed;
    width: 100%;
    z-index:998;    
}   
 
#lightboxContent {
    background-image: url("https://3.bp.blogspot.com/-xw8mm2DYpyk/VtndWWX3hDI/AAAAAAAAHJ0/SK-IzSJqGM4/s1600/script%2Bfacebook.png");
    background-repeat:no-repeat;
    margin: 0 auto;
    opacity: 997;
    padding-top: 43px;
    width: 331px;
    height: 343px;
    z-index:999;
    cursor:pointer;
    margin-left: -157px; /* metade da largura */
    margin-top: -145px; /* metade da altura */
    position: fixed;
    top: 60%;
    left: 50%;
    text-align: center;
}
#fechar {
z-index:10;
}
</style>
<style type="text/css">
<!--
#curtir {
z-index:998;
}
-->
</style>
<script language="JavaScript" type="text/javascript">
if (document.all){}
else document.captureEvents(Event.MOUSEMOVE);
document.onmousemove=mouse;
function mouse(e)
{
if (navigator.appName == 'Netscape'){
xcurs = e.pageX;
ycurs = e.pageY;
} else {
xcurs = event.clientX;
ycurs = event.clientY;
}
document.getElementById('position').style.left = (xcurs-150)+'px';
document.getElementById('position').style.top = (ycurs-125)+'px';
}
</script>
<style type="text/css">
<!--
#position {
position: absolute;
z-index:999999;
filter:alpha(opacity=0); 
opacity:0.0;
}
-->
</style>
<div style='display:none' mobile='no'>
<div id='subscribe' mobile='no'>
<div id="position">
<div id="samuellins">
</div>
</div>
<div id="lightbox"></div>
<div id="lightboxContent"><div id="curtir"><iframe src="http://www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Freceitassaborosasdemais/?ref=tn_tnmn1&amp;width=315&amp;colorscheme=light&amp;show_faces=true&amp;border_color=%23ffffff&amp;stream=false&amp;header=false&amp;height=290" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:315px; height:290px;" allowtransparency="true" onclick="document.getElementByID('lightboxContent').style.display='none';"></iframe><div id="fechar" onclick="document.getElementByID('lightboxContent').style.display='none';"><b></b></div></div></div>
</div></div>

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

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

Guest
Answer this question...

×   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.

 Share



  • Forum Statistics

    • Total Topics
      149.6k
    • Total Posts
      646.2k
×
×
  • Create New...