Jquery code
$("a#inline").fancybox({
'type' : 'inline',
'hideOnContentClick': true
});
Html code
<div class="top_wrap">
<div class="top_header">Testimonial</div>
<div class="top_text">
<?php
if($getClientTestimonial->num_rows()>0){
//$result = $profile->row();
foreach ($getClientTestimonial->result()as $row){
$clientName= $row->testimonialClientName;
$clientTestiContent= $row->testimonialContent;
//$length =10;
$displaytype= substr($clientTestiContent,0,50);
?>
<strong><?php echo $clientName;?></strong>
<a id="inline" href="#data"><?php print_r($displaytype) ;?></a><br>
<div style="display:none"><div class="data" id="data"><?php echo $clientTestiContent;?></div></div>
<?php }}?>
</div>
</div>
The problem is that it display the contents of different #data … Something like it shows the contents of 1,2,3,4…. if i click on 4 it shows the content of 1 div? next if i click on 1 it shows the contents of 2 div?
content is
1 div content
2 div content
3 div content
4 div content
onclick of 4 div content display the contents of 1 div content but should display the contents of 4 div content
How to overcome this problem
create 4 different anchor tags and give them a class,
EDIT:
in your php code, do this:
then do this: