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&rel=0&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&rel=0&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'
});
});
});