Foros del Web » Creando para Internet » Diseño web »

Popup lightbox automatico al iniciar un sitio

Estas en el tema de Popup lightbox automatico al iniciar un sitio en el foro de Diseño web en Foros del Web. alguien sabe como hacer que mi sitio al abrir por primera vez lance un popup tipo lightbox sin hacer click en un botón que salte ...
  #1 (permalink)  
Antiguo 04/07/2008, 08:47
Avatar de linker  
Fecha de Ingreso: noviembre-2002
Ubicación: Chile
Mensajes: 232
Antigüedad: 21 años, 5 meses
Puntos: 0
Popup lightbox automatico al iniciar un sitio

alguien sabe como hacer que mi sitio al abrir por primera vez lance un popup tipo lightbox sin hacer click en un botón que salte automático

igual a esto
http://www.metrosantiago.cl/

saludos
__________________
Somos criaturas productos de una idea
--------------------------------------
Linker :: Diseño tecnologías y algo Más

--------------------------------------
  #2 (permalink)  
Antiguo 04/07/2008, 11:52
Avatar de hCanté
Colaborador
 
Fecha de Ingreso: marzo-2007
Ubicación: Guatemala
Mensajes: 233
Antigüedad: 17 años, 1 mes
Puntos: 9
De acuerdo Respuesta: Popup lightbox automatico al iniciar un sitio

Hola,

buena pregunta, habria que ver el o los .js, para ver si se puede cambiar algún valor para que este en auto:true; o algo así... otra cosa sería saber cual estan usando porque hay varios

Saludos,
  #3 (permalink)  
Antiguo 05/07/2008, 16:48
Avatar de Fastback  
Fecha de Ingreso: marzo-2008
Ubicación: Santiago de Chile
Mensajes: 35
Antigüedad: 16 años, 1 mes
Puntos: 0
Respuesta: Popup lightbox automatico al iniciar un sitio

Tambien quiero conseguir lo mismo, esperemos que alguien nos pueda ayudar.
  #4 (permalink)  
Antiguo 06/07/2008, 10:56
Avatar de Fastback  
Fecha de Ingreso: marzo-2008
Ubicación: Santiago de Chile
Mensajes: 35
Antigüedad: 16 años, 1 mes
Puntos: 0
Respuesta: Popup lightbox automatico al iniciar un sitio

Hoy encontre un ejemplo de otra versión de Lightbox o Multibox http://www.phatfusion.net/multibox/

Mi pregunta es, si algun usuario ha ocupado esta herramienta y le ha funcionado para que me aclare algunas dudas que tengo, puesto que descargue el ejemplo, pero no me funciona en mi pc.

Saludos,

Fastback
  #5 (permalink)  
Antiguo 02/08/2008, 16:14
 
Fecha de Ingreso: septiembre-2007
Mensajes: 1
Antigüedad: 16 años, 7 meses
Puntos: 0
Respuesta: Popup lightbox automatico al iniciar un sitio

Espero que este programa te sirva para lo que deseas hacer, checalo, y me dices si es lo que querias hacer se llama AWESOMEPOPUP
  #6 (permalink)  
Antiguo 02/08/2008, 17:59
 
Fecha de Ingreso: octubre-2004
Mensajes: 289
Antigüedad: 19 años, 6 meses
Puntos: 10
Respuesta: Popup lightbox automatico al iniciar un sitio

Muchas gracias por la reseña, therlenius.

Es perfecto para el uso que pedía el compañero linker y en el que yo también estaba interesado.

De nuevo, gracias.

Saludos
  #7 (permalink)  
Antiguo 15/10/2008, 11:35
 
Fecha de Ingreso: octubre-2008
Mensajes: 13
Antigüedad: 15 años, 6 meses
Puntos: 1
Respuesta: Popup lightbox automatico al iniciar un sitio

Cita:
Iniciado por linker Ver Mensaje
alguien sabe como hacer que mi sitio al abrir por primera vez lance un popup tipo lightbox sin hacer click en un botón que salte automático

saludos

HOLA bueno yo estoy buscando lo mismo.. un popup en lightbox que se abra luego de unos segundos... el lightbox ya lo tengo y funciona bien haciendo click en la imagen. pero no se como hacer para que arranque y se presente la imagen una vez que se carga el sitio.

gracias.
  #8 (permalink)  
Antiguo 15/10/2008, 16:56
 
Fecha de Ingreso: octubre-2004
Mensajes: 289
Antigüedad: 19 años, 6 meses
Puntos: 10
Respuesta: Popup lightbox automatico al iniciar un sitio

Si sigues y lees bien el hilo verás que el amigo therlenius proporcionó el nombre del producto que buscas... y funciona perfecto.

Muchas gracias, de nuevo, a therlenius.
  #9 (permalink)  
Antiguo 15/10/2008, 17:13
 
Fecha de Ingreso: octubre-2008
Mensajes: 4
Antigüedad: 15 años, 6 meses
Puntos: 0
Respuesta: Popup lightbox automatico al iniciar un sitio

Una manera sencilla de hacerlo es mediante una funcion que haga click al boton que detona la light box...

en el evento Onload del body


alggo asi como

function lightboxauto()
{
document.getElementById('iddelbotonquedetonalightb ox').click();
}


<body onload="lightboxauto()">

Creo yo que esta es una forma.
  #10 (permalink)  
Antiguo 26/11/2008, 14:47
 
Fecha de Ingreso: septiembre-2006
Ubicación: Buenos Aires
Mensajes: 82
Antigüedad: 17 años, 6 meses
Puntos: 0
Respuesta: Popup lightbox automatico al iniciar un sitio

de donde lo bajaron?
  #11 (permalink)  
Antiguo 27/11/2008, 00:16
Avatar de hCanté
Colaborador
 
Fecha de Ingreso: marzo-2007
Ubicación: Guatemala
Mensajes: 233
Antigüedad: 17 años, 1 mes
Puntos: 9
De acuerdo Respuesta: Popup lightbox automatico al iniciar un sitio

Cita:
Iniciado por Fastback Ver Mensaje
Hoy encontre un ejemplo de otra versión de Lightbox o Multibox http://www.phatfusion.net/multibox/

Mi pregunta es, si algun usuario ha ocupado esta herramienta y le ha funcionado para que me aclare algunas dudas que tengo, puesto que descargue el ejemplo, pero no me funciona en mi pc.

Saludos,

Fastback
Hola!

Dejaron el enlace, esta en la cita de arriba, el tema ya tiene sus meses.

Saludos!
  #12 (permalink)  
Antiguo 27/11/2008, 11:07
 
Fecha de Ingreso: septiembre-2006
Ubicación: Buenos Aires
Mensajes: 82
Antigüedad: 17 años, 6 meses
Puntos: 0
Respuesta: Popup lightbox automatico al iniciar un sitio

estoy hablando del AWESOMEPOPUP obvio

que tiene que ver que tenga sus meses para eso es el foro no?

si hay me indica agradecido estare

saludos
  #13 (permalink)  
Antiguo 27/11/2008, 11:09
 
Fecha de Ingreso: septiembre-2006
Ubicación: Buenos Aires
Mensajes: 82
Antigüedad: 17 años, 6 meses
Puntos: 0
Respuesta: Popup lightbox automatico al iniciar un sitio

Cita:
Iniciado por xthjan Ver Mensaje
Una manera sencilla de hacerlo es mediante una funcion que haga click al boton que detona la light box...

en el evento Onload del body


alggo asi como

function lightboxauto()
{
document.getElementById('iddelbotonquedetonalightb ox').click();
}


<body onload="lightboxauto()">

Creo yo que esta es una forma.
done esito estas linas?

gracias
  #14 (permalink)  
Antiguo 27/11/2008, 11:42
 
Fecha de Ingreso: octubre-2004
Mensajes: 289
Antigüedad: 19 años, 6 meses
Puntos: 10
Respuesta: Popup lightbox automatico al iniciar un sitio

Aquí lo tienes

http://www.awesomepopup.com/
  #15 (permalink)  
Antiguo 27/11/2008, 12:11
 
Fecha de Ingreso: septiembre-2006
Ubicación: Buenos Aires
Mensajes: 82
Antigüedad: 17 años, 6 meses
Puntos: 0
Respuesta: Popup lightbox automatico al iniciar un sitio

y gratuito? ;)
  #16 (permalink)  
Antiguo 27/04/2009, 21:52
(Desactivado)
 
Fecha de Ingreso: octubre-2008
Ubicación: Lima
Mensajes: 190
Antigüedad: 15 años, 6 meses
Puntos: 3
Mensaje Respuesta: Popup lightbox automatico al iniciar un sitio

el js es este
Código PHP:
<!-- Begin 

var expDays 0// number of days the cookie should last

function GetCookie (name) { 
var 
arg name "="
var 
alen arg.length
var 
clen document.cookie.length
var 
0
while (
clen) {   
var 
alen;   
if (
document.cookie.substring(ij) == arg)     
return 
getCookieVal (j);   
document.cookie.indexOf(" "i) + 1;   
if (
== 0) break;  

return 
null;
}
function 
SetCookie (namevalue) { 
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(offsetendstr));
}

var 
page "AQUI VA LA RUTA";
var 
PopupWidth 500;  //Change the PopupWidth to your requirements.
var ScreenWidth screen.width;//Change to your available screen width.
document.write('<div id="a1">');
document.write('<div id="awesomePopup" style="display:none;">');
document.write('<div style="position: fixed;">');
document.write('<div id="myid" style="width:500px; height:400px;">');
document.write('<div style="width:500px;height=400px;">');
var 
frameheight 400;
if (
frameheight 500) {
var 
frameheight 500;
}
document.write('<iframe style="border:5px solid #FF6600;margin-top:0px;margin-left:0px;margin-right:0px;margin-bottom:0px" frameborder=0 border=0 width=500 height=' frameheight ' src="' page '"></iframe>');
document.write('</div>');
document.write('</div>');
document.write('</div>');
document.write('</div>');
document.write('</div>');
var 
SetPopup document.getElementById("popup");
document.write('<div id="popup" style="visibility:hidden;z-index:4;width:'+PopupWidth+';position:absolute;"></div>');

function 
StartPopup(objC,c) {
    
SetPopup document.getElementById("popup");
    
SetPopup.innerHTML c.innerHTML
    SetPopup
.style.left =  (screen.width -  PopupWidth)///getPos(objC,"Left");
    
var ScreenSize getPos(objC,"Left") + PopupWidth;
    if (
ScreenSize ScreenWidth) {
        var 
scrOffsetC getPos(objC,"Left") +  PopupWidth - (ScreenWidth);
        
SetPopup.style.left getPos(objC,"Left") - (scrOffsetC 0);
    }
    
SetPopup.style.top 90// getPos(objC,"Top") + objC.offsetHeight))/2;
    
SetPopup.style.visibility 'visible';
    
document.body.innerHTML+='<div id="UpBck" style="position:absolute;width:'+ScreenWidth+';height:100%;top:0px;left:0px;background:#000000;filter:alpha(opacity=60);-moz-opacity:0.6;opacity:0.6;">'
    
UpBck.style.visibility 'visible';
    
document.body.style.overflow "hidden";
}

function 
getPos(objC,sPos) {
    var 
iPos 0;
    while (
objC != null) {
        
iPos += objC;
        
objC objC.offsetParent;
    }
    return 
iPos;
}

function 
CloseAwesomePopup() {
    
SetPopup document.getElementById("popup");
    
SetPopup.style.visibility 'hidden';
    
UpBck.style.visibility 'hidden';
    
document.body.style.overflow "auto";
}

function 
checkCount(delay) {
    var 
count GetCookie('count');
    if (
count == null) {
        
count=1;
        
SetCookie('count'countexp);
        
popdelay delay;    // time in seconds before popup opens
        
setTimeout('StartPopup(a1,awesomePopup)'popdelay*1000);
    } else {
        
count++;
        
SetCookie('count'countexp);
    }
}

function 
checkCounts() {
    var 
count GetCookie('count');
    if (
count == null) {
        
count=1;
        
SetCookie('count'countexp);
        
StartPopup(a1,awesomePopup);
    } else {
        
count++;
        
SetCookie('count'countexp);
    }
}

function 
ShowPop(delay) {
    
popdelay delay;    // time in seconds before popup opens
    
setTimeout('StartPopup(a1,awesomePopup)'popdelay*1000);
}

// End --> 


y en el body se coloca

Código PHP:
<BODY onLoad="checkCount(3)"
checkCount(3) (3) es el tiempo en segundos, puedes colocarle 0 si deseas.....

bueno eso es todo :P
  #17 (permalink)  
Antiguo 29/08/2009, 07:32
 
Fecha de Ingreso: julio-2009
Mensajes: 53
Antigüedad: 14 años, 8 meses
Puntos: 1
Respuesta: Popup lightbox automatico al iniciar un sitio

Cita:
Iniciado por ssclamp Ver Mensaje
Aquí lo tienes

Tiene un grave error en cualquiera versión del Ie, por ejemplo antes que te salga la ventana del pop-up, si estas navegando (por ejemplo si tas en el footer de la pagina), se clava y te quita la barra de desplazamiento! Eso sería fatal si lo implementas en una web, te auyentaría todos los usuarios, sorry por revivir el post pero es un DATO A TENER EN CUENTA!
  #18 (permalink)  
Antiguo 20/06/2011, 15:00
 
Fecha de Ingreso: junio-2011
Mensajes: 1
Antigüedad: 12 años, 10 meses
Puntos: 0
De acuerdo Respuesta: Popup lightbox automatico al iniciar un sitio

Mi pregunta es este Code lo copio como un archivo de Java Script, que nombre le puedo poner para que lo reconosca el body en el index, puede ser el index un html



Cita:
Iniciado por timz Ver Mensaje
el js es este
Código PHP:
<!-- Begin 

var expDays 0// number of days the cookie should last

function GetCookie (name) { 
var 
arg name "="
var 
alen arg.length
var 
clen document.cookie.length
var 
0
while (
clen) {   
var 
alen;   
if (
document.cookie.substring(ij) == arg)     
return 
getCookieVal (j);   
document.cookie.indexOf(" "i) + 1;   
if (
== 0) break;  

return 
null;
}
function 
SetCookie (namevalue) { 
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(offsetendstr));
}

var 
page "AQUI VA LA RUTA";
var 
PopupWidth 500;  //Change the PopupWidth to your requirements.
var ScreenWidth screen.width;//Change to your available screen width.
document.write('<div id="a1">');
document.write('<div id="awesomePopup" style="display:none;">');
document.write('<div style="position: fixed;">');
document.write('<div id="myid" style="width:500px; height:400px;">');
document.write('<div style="width:500px;height=400px;">');
var 
frameheight 400;
if (
frameheight 500) {
var 
frameheight 500;
}
document.write('<iframe style="border:5px solid #FF6600;margin-top:0px;margin-left:0px;margin-right:0px;margin-bottom:0px" frameborder=0 border=0 width=500 height=' frameheight ' src="' page '"></iframe>');
document.write('</div>');
document.write('</div>');
document.write('</div>');
document.write('</div>');
document.write('</div>');
var 
SetPopup document.getElementById("popup");
document.write('<div id="popup" style="visibility:hidden;z-index:4;width:'+PopupWidth+';position:absolute;"></div>');

function 
StartPopup(objC,c) {
    
SetPopup document.getElementById("popup");
    
SetPopup.innerHTML c.innerHTML
    SetPopup
.style.left =  (screen.width -  PopupWidth)///getPos(objC,"Left");
    
var ScreenSize getPos(objC,"Left") + PopupWidth;
    if (
ScreenSize ScreenWidth) {
        var 
scrOffsetC getPos(objC,"Left") +  PopupWidth - (ScreenWidth);
        
SetPopup.style.left getPos(objC,"Left") - (scrOffsetC 0);
    }
    
SetPopup.style.top 90// getPos(objC,"Top") + objC.offsetHeight))/2;
    
SetPopup.style.visibility 'visible';
    
document.body.innerHTML+='<div id="UpBck" style="position:absolute;width:'+ScreenWidth+';height:100%;top:0px;left:0px;background:#000000;filter:alpha(opacity=60);-moz-opacity:0.6;opacity:0.6;">'
    
UpBck.style.visibility 'visible';
    
document.body.style.overflow "hidden";
}

function 
getPos(objC,sPos) {
    var 
iPos 0;
    while (
objC != null) {
        
iPos += objC;
        
objC objC.offsetParent;
    }
    return 
iPos;
}

function 
CloseAwesomePopup() {
    
SetPopup document.getElementById("popup");
    
SetPopup.style.visibility 'hidden';
    
UpBck.style.visibility 'hidden';
    
document.body.style.overflow "auto";
}

function 
checkCount(delay) {
    var 
count GetCookie('count');
    if (
count == null) {
        
count=1;
        
SetCookie('count'countexp);
        
popdelay delay;    // time in seconds before popup opens
        
setTimeout('StartPopup(a1,awesomePopup)'popdelay*1000);
    } else {
        
count++;
        
SetCookie('count'countexp);
    }
}

function 
checkCounts() {
    var 
count GetCookie('count');
    if (
count == null) {
        
count=1;
        
SetCookie('count'countexp);
        
StartPopup(a1,awesomePopup);
    } else {
        
count++;
        
SetCookie('count'countexp);
    }
}

function 
ShowPop(delay) {
    
popdelay delay;    // time in seconds before popup opens
    
setTimeout('StartPopup(a1,awesomePopup)'popdelay*1000);
}

// End --> 


y en el body se coloca

Código PHP:
<BODY onLoad="checkCount(3)"
checkCount(3) (3) es el tiempo en segundos, puedes colocarle 0 si deseas.....

bueno eso es todo :P
  #19 (permalink)  
Antiguo 23/06/2011, 05:45
Avatar de jomaruro
Colaborador
 
Fecha de Ingreso: junio-2002
Ubicación: Naboo
Mensajes: 5.442
Antigüedad: 21 años, 9 meses
Puntos: 361
Respuesta: Popup lightbox automatico al iniciar un sitio

Hola:

No entiendo nada de javascript, como tampoco entiendo que si la duda es sobre javascript no se postee en el foro apropiado.

Interpreto que si el código HTML dice esto:

Código HTML:
Ver original
  1. <BODY onLoad="checkCount(3)">

es porque al cargarse la página hace una llamada a la función checkCount a la que se le pasa un parámetro con valor 3, así que ¿Cuál crees tu que debería ser el nombre del js?.

Saludos.



P.D.: www.librosweb.es
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 03:23.