Hi,
I am struggling with this..I have multiple images and data with same class. As I click on a link with class
single_image it should pop up the corresponding div.
but its not working every time i click it shows me the same image.
I have tried using $("a.single_image").each( function () { $(this).fancybox({ }]; }];but this is also not working
refer code below..
jquery script:
<script type="text/javascript">
$("a.single_image").fancybox({
'href' : '#data',
'titleShow' : false,
'transitionIn' : 'elastic',
'transitionOut' : 'elastic'
});
</script>
php script:
while($row = mysql_fetch_array($query)) {
echo "<a class='single_image' href='#data'>" . $row[4] . "</a><br/>";
echo '<div style="display:none"><div id="data">
<img src="../word/wordpress/wp-content/plugins/mall_events/images/' . $row[9] . '"/><br/>
Lorem ipsum dolor sit amet, consectetur adipiscing elit.</div></div>';
}
Thanks in advance.