Ayuda con un popup

  • Autor Autor Pduma
  • Fecha de inicio Fecha de inicio
P

Pduma

Curioso
¡Usuario con pocos negocios! ¡Utiliza siempre saldo de Forobeta!
HTML:
<div align='center'><script>function ventanaSecundaria(){t=11;timer=window.setInterval('contador()',1000);hija=window.open('http://xxxxxxxx.com/popup.php','ventana','width=640,height=425,scrollbars=0')}function contador(){if(hija!=null){if(hija.closed){alert('Clicke un anuncio y espere 10 segundos');clearInterval(timer);t=10;document.getElementById('contador').value='Mostrar Video';return}if(hija.frames.length!=3){t=t-1;if(t<=0){clearInterval(timer);document.getElementById('hide').style.display='';t='Video'}document.getElementById('contador').value=t;return false}}}</script>
		<div style='margin:20px; margin-top:5px'>
			<div class='smallfont' style='margin-bottom:2px'></i> 
				<p class='Boton BtnGreen'>
				<input type='button' id='contador' value='Mostrar Video!' style='width:297;height=35;font-weight:bold;font-size:16px;margin:0px;padding:0px' onClick=ventanaSecundaria()></div>
			<div class='alt2' style='margin: 0px; padding: 6px; border: 1px inset;'>
				<div id='hide' style='display: none;'>
				<div class='info_bbc'>
					"<iframe width="560" height="315" src="https://www.youtube.com/embed/MKZ6lr0tdcc" frameborder="0" allowfullscreen></iframe>" </div></div>
		</div></div></div>

ME PUEDE AYUDAR CREANDO CON EL LICK QUE TIENE SE DETIENE EL CONTADOR PERO COLOCO MI PAGINA DE POPUP Y NO SE DETIENE ALGUIEN ME AYUDAR -- COMO PUEDO CREAR EL POPUP.. GRACIAS
 
Buenas, tienes un if al revés, el código correcto sería así:
HTML:
<div align='center'><script>function ventanaSecundaria(){t=11;timer=window.setInterval('contador()',1000);hija=window.open('http://xxxxxxxx.com/popup.php','ventana','width=640,height=425,scrollbars=0')}function contador(){if(hija!=null){if(hija.closed){alert('Clicke un anuncio y espere 10 segundos');clearInterval(timer);t=10;document.getElementById('contador').value='Mostrar Video';return}if(hija.frames.length==3){t=t-1;if(t<=0){clearInterval(timer);document.getElementById('hide').style.display='';t='Video'}document.getElementById('contador').value=t;return false}}}</script>
		<div style='margin:20px; margin-top:5px'>
			<div class='smallfont' style='margin-bottom:2px'></i> 
				<p class='Boton BtnGreen'>
				<input type='button' id='contador' value='Mostrar Video!' style='width:297;height=35;font-weight:bold;font-size:16px;margin:0px;padding:0px' onClick=ventanaSecundaria()></div>
			<div class='alt2' style='margin: 0px; padding: 6px; border: 1px inset;'>
				<div id='hide' style='display: none;'>
				<div class='info_bbc'>
					"<iframe width="560" height="315" src="https://www.youtube.com/embed/MKZ6lr0tdcc" frameborder="0" allowfullscreen></iframe>" </div></div>
		</div></div></div>

P.D: En HTML lo recomendado es usar comillas dobles en vez de simples
 
Atrás
Arriba