[RISOLTO]colorbox jquery e variabile

2 contenuti / 0 new
Ultimo contenuto
[RISOLTO]colorbox jquery e variabile

ho questa codice jquery:

$(document).ready(function(){
$(".youtube-button").click(function(){
var url = $('.youtube', this).attr('src');
$.colorbox({
html:function() {return '<div><iframe src="' + url + '" height="315" width="400"></iframe></div>';},
iframe:true
});
});
});

il mio html è il seguente:

<div class="youtube-button"><iframe class="youtube" width="65" height="65" src="http://www.youtube.com/embed/AU9Ad-xV5Gk?hd=1&amp;rel=0&amp;autoplay=0&a... frameborder="0" allowfullscreen></iframe></div><div class="youtube-button"><iframe class="youtube" width="65" height="65" src="http://www.youtube.com/embed/YjI_M9C2MTM?hd=1&amp;rel=0&amp;autoplay=0&a... frameborder="0" allowfullscreen></iframe></div></div>  </div> 

devo fare praticamente che colorbox carichi dell'html con un iframe all'interno con una variabile nel src dell'iframe...

trovato soluzione...
ringrazio cavax

$(document).ready(function(){
$(".youtube-button").click(function(){
  var url = $(this).children().attr('src');
   $.colorbox({
   href:url,
   iframe:true,
   height:'315px',
   width:'400px'
   });
});
});