Ver Mensaje Individual
  #1 (permalink)  
Antiguo 28/09/2012, 07:52
jisrrael
 
Fecha de Ingreso: abril-2005
Mensajes: 16
Antigüedad: 19 años
Puntos: 1
Detener video del youtube con codigo javascript.

Buenas tardes, mi problema que cargo un video del youtube dentro de un lighbox (usando moodalbox), el problema es que cuando cierro el ligtbox el video continua su reproducción.

Código en el que se carga el video dentro del lightbox:
<iframe type="text/html" width="400" height="397" src="http://www.youtube.com/embed/<?php echo $datos['Link_video']?>?rel=0&amp;wmode=transparent" frameborder="0"></iframe>

¿Como puedo hacer para que cuando le de cerrar a mi lightbox el video se detenga?.

El codigo javascript que controla el cierre de la ventana lightbox esta en el fichero moodalbox.js

// the overlay (clickable to close)
this.overlay = new Element('div').setProperty('id', 'mb_overlay').injectInside(document.body);
// the center element
this.center = new Element('div').setProperty('id', 'mb_center').setStyles({width: this.options.initialWidth+'px', height: this.options.initialHeight+'px', marginLeft: '-'+(this.options.initialWidth/2)+'px', display: 'none'}).injectInside(document.body);
// the actual page contents
this.contents = new Element('div').setProperty('id', 'mb_contents').injectInside(this.center);

// the bottom part (caption / close)
this.bottom = new Element('div').setProperty('id', 'mb_bottom').setStyle('display', 'none').injectInside(document.body);
this.closelink = new Element('a').setProperties({id: 'mb_close_link', href: '#'}).injectInside(this.bottom);
this.caption = new Element('div').setProperty('id', 'mb_caption').injectInside(this.bottom);
new Element('div').setStyle('clear', 'both').injectInside(this.bottom);

Cualquier ayuda se agradece y mucho !!!

Un saludo a todos los colaboradores !