0

<?php
 $sqlInner=" select * from gallery_photos where series_id='".$row['id']."' ";
 $rr = mysql_query($sqlInner,$con); 
 while($data=mysql_fetch_array($rr))    {
    echo"<a class='fancybox' rel='gallery' href='images/gallery_photos/".$data['photo_path']."'><img src='images/gallery_photos/".$data['photo_path']."'width='150' height='150' ></a>";
 }
?>


 <script type="text/javascript">
  $(document).ready(function() {
    $(".fancybox").fancybox({'type' : 'image'})
});
</script>

it didn't work for me, I'm just a beginner. Help needed.

Thanks in advance.

  • Please be aware that the mysql extension (supplying the mysql_ functions) has been deprecated since 2012, in favor of the mysqli and PDO extensions. It's use is highly discouraged. See http://stackoverflow.com/questions/12859942/why-shouldnt-i-use-mysql-functions-in-php – Oldskool May 29 '14 at 12:19

3 Answers3

1

is it working fine with static images? If yes then try below code

<script type="text/javascript">
    $(document).ready(function() {
     $(".fancybox").fancybox({type : 'image'})
    });
</script>
0

try to remove "type:image":

<script type="text/javascript">
$(document).ready(function() {
    $(".fancybox").fancybox();
});

0

Try adding data-fancybox-type="image" property to anchor tags. It worked for me.