Hi I am trying to use FancyBox in a page I am making containing videos, Like a Gallery of videos, my intention is to be linking YouTube videos in.
The issue I get is it just links through to the age link a normal a
tag would do and nothing else happens.
This is the code I am using to generate the videos.
while ($row = mysqli_fetch_assoc($result)){
echo "
<div class='portalVideo'>
<a class='fancybox fancybox.iframe' href='https://www.youtube.com/watch?v=DB7jsjt4Uec'>
<h3>
<strong>".$row["VideoName"]."</strong>
</h3>
</a>
</div>";
}
All my video link are pulled from a database and then displayed on the page as a a text link which "should" open the iframe
when clicked. The only aspect that doesn't work is the iframe
. everything else pulls and displays correctly.
I have included the files correctly and they link correctly to the resources. just for consolidation see below.
<script type="text/javascript" src="scripts/jquery.fancybox-1.3.4.pack.js"></script>
<link rel="stylesheet" type="text/css" href="css/jquery.fancybox-1.3.4.css">
Based off this stack overflow post I have tried to fix it. My code does contain the jquery below just under the head tags.
<script type="text/javascript">
$(document).ready(function() {
$('a.fancybox').fancybox();
});
</script>