I am using multiple buttons (dynamic) that opens a single div:
<div class="dialog" title="Player">
<p>YouTube Player here</p>
</div>
and at the header I am using:
<script>
$(function() {
$(".dialog").dialog({
autoOpen: false,
show: {
effect: "blind",
duration: 1000
},
hide: {
effect: "blind",
duration: 1000
}
});
$(".opener").click(function() {
$(".dialog").dialog("open");
});
});
</script>
I get the buttons use like this:
foreach ($ytObject->RKT_requestResult->entry as $video) {
return = $ytObject->parseVideoRow($video);
$delimiter = "**";
$VideoContent = explode($delimiter, $return);
if ($count % 2 == 0) {
echo "<div class=\"ResultEven\">";
echo "<button class=\"opener btn\" class=\"btn\">Play</button> ";
echo "<a href = \"" . $VideoContent['0'] . "\" class=\"btn\">Download</a> ";
echo $VideoContent['6'];
echo "</div>";
} else {
echo "<div class=\"ResultOdd\">";
echo "<button class=\"opener btn\" class=\"btn\">Play</button> ";
echo "<a href = \"" . $VideoContent['0'] . "\" class=\"btn\">Download</a> ";
echo $VideoContent['6'];
echo "</div>";
}
$count++;
}
I want to get the value of $VideoContent['0']
as the pop-up content of <div class="dialog" title="player">
so that I can put the YouTube video directly on the modal.