Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7541865
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:00:27+00:00 2026-05-30T08:00:27+00:00

Jquery code $(a#inline).fancybox({ ‘type’ : ‘inline’, ‘hideOnContentClick’: true }); Html code <div class=top_wrap> <div

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T08:00:29+00:00Added an answer on May 30, 2026 at 8:00 am

    create 4 different anchor tags and give them a class,

    <a id="inline1"  href="#data1" class='fancybox-anchor-tag'><?php print_r($displaytype) ;?></a><br>
    <div style="display:none"><div class="data" id="data1"><?php echo $clientTestiContent;?></div></div>
    <a id="inline2"  href="#data2" class='fancybox-anchor-tag'><?php print_r($displaytype) ;?></a><br>
    <div style="display:none"><div class="data" id="data2"><?php echo $clientTestiContent;?></div></div>
    <a id="inline3"  href="#data3" class='fancybox-anchor-tag'><?php print_r($displaytype) ;?></a><br>
    <div style="display:none"><div class="data" id="data3"><?php echo $clientTestiContent;?></div></div>
    <a id="inline4"  href="#data4" class='fancybox-anchor-tag'><?php print_r($displaytype) ;?></a><br>
    <div style="display:none"><div class="data" id="data4"><?php echo $clientTestiContent;?></div></div>
    

    EDIT:

    in your php code, do this:

    <?php 
    if($getClientTestimonial->num_rows()>0){
    $i = 1;
        //$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<?php echo $i; ?>"  href="#data<?php echo $i; ?>" class="fancybox-anchor-tag"><?php print_r($displaytype) ;?></a><br>
              <div style="display:none"><div class="data" id="data<?php echo $i; ?>"><?php echo $clientTestiContent;?></div></div>
    
    <?php 
    $i++;
    }}?>
    

    then do this:

    $('a.fancybox-anchor-tag')
        .each(
            function ( e )
            {            
                $(this).fancybox({
                    'type' : 'inline',
                    'hideOnContentClick': true
                });
            }
        );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have jquery code like this: html += '<div class=index>' + item.index +
I have written jQuery code, in files Main.html and ajax.php . The ajax.php file
Here's my code: <div class=image> <img src=image.jpg alt=Image description /> <p class=caption>This is the
View page contains jquery code to set margin on div. below is the code
I have the following page: <div style=display: inline> <input type=button id=txt value=Add TextBox style=
I tried to write some sloppy jQuery code for an inline-confirm dialog. It works
The below HTML/CSS/Javascript (jQuery) code displays the #makes select box. Selecting an option displays
You can view my custom slider here: http://www.awaismuzaffar.com/examples/index.html And below is the JQuery code
Hello I am using this jquery code onclick=jQuery('.hidden').show() to show the class labeled .hidden
my jquery code not run with IE6 but runs all others including IE7. It

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.