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

  • SEARCH
  • Home
  • 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 8215911
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T11:56:50+00:00 2026-06-07T11:56:50+00:00

Okay, here’s my problem. I have a page where I use toggle to show/hide

  • 0

Okay, here’s my problem.
I have a page where I use toggle to show/hide information about an article with a click on the name.
And I have another page that use jQuery UI Tabs to display the same page but with different parameter (to be exact 3 tabs: order by Rate, by Date and by Name).

So everything working fine until I start to switch tabs and try to toggle element in this other tabs:
– Sometimes everything works normal
– Sometimes nothing happend.
– Sometimes it toggle several times as if the script was loaded several times.

To be more precise here’s my code:

Page where I display tabs:

    <link rel="stylesheet" href="/projectsoul/CSS/design/jquery.ui.all.css" />
    <link rel="stylesheet" href="/projectsoul/CSS/design/jquery-ui-1.8.21.custom.css" />
    <script type="text/javascript" src="/projectsoul/JS/jquery-1.7.2.min.js"></script>
    <script type="text/javascript" src="/projectsoul/JS/jquery-1.7.2.js"></script>
    <script type="text/javascript" src="/projectsoul/JS/jquery-ui-1.8.21.custom.min.js">                       </script>

               ...
                 ...
                 ...
        <div id="content" class="content" class="ui-tabs">
        <ul>
            <li><a href="articles.php" ><span>By Date</span></a></li>
            <li><a href="articles.php?orderby=rate"><span>By Rate</span></a></li>
            <li><a href="articles.php?orderby=name"><span>By Name</span></a></li>
        </ul>
    </div>

     .... 
     ....
     ....


        $( "#content" ).tabs({
        ajaxOptions: {
            error: function( xhr, status, index, anchor ) {
                $( anchor.hash ).html(
                    "Fail to load content."
                     );
            }
        }
    });

    $( "#content").tabs({
            fx: { height: 'toggle', opacity: 'toggle', duration: 'slow' }
        });

    $('#content').tabs({
        load: function(event, ui) {
            $(ui.panel).delegate('.intabs', 'click', function(event) {
                $(ui.panel).load(this.href);
                event.preventDefault();
            });
        }
    });

And now, here is the page i display in these tabs:

    <link rel="stylesheet" href="/projectsoul/CSS/design/jquery.ui.all.css" />
<link rel="stylesheet" href="/projectsoul/CSS/design/jquery-ui-1.8.21.custom.css" />
<script type="text/javascript" src="/projectsoul/JS/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="/projectsoul/JS/jquery-1.7.2.js"></script>
<script type="text/javascript" src="/projectsoul/JS/jquery-ui-1.8.21.custom.min.js"></script>

 <?php
while($articles= $articles_data->fetch())
{?>

 <h2><a class="toggler" id="displayText<?php echo $articles["id"] ?>"><?php echo nl2br(htmlspecialchars($articles["name"])); ?></a></h2>

  ... 
  ...

  <div class="toggle" id="displayText<?php echo $articles["id"] ?>_content">
 // CONTENT                 
  </div>


   } 
   // END OF WHILE

    <script>
    $(document).ready(function() {
       $('.toggle').hide();
       $('.toggler').click( function() {
            var target = this.id + '_content';
            // Use ID-selectors to toggle a single element.
            $('#' + target).toggle();
            // Use class-selectors to toggle groups of elements.
            $('.' + target).toggle();
            $('.toggle.always').toggle();
        });
     });
     </script>

As I said, the toggling work when the second page is displayed alone. But in tabs and after switching it doesn’t work anymore.

I’ve searched but didn’t find anything that seems to be like that…
Any idea ?

I hope I made myself clear ^^”

  • 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-06-07T11:56:52+00:00Added an answer on June 7, 2026 at 11:56 am

    Okay, problem resolved.

    For those who have problem like that:

    The problem mainly comes from the fact that content loads on each tabs and there is no distinct value in ID of toggled div between tabs.
    I just changed :

        <div class="toggle" id="displayText<?php echo $articles["id"] ?>_content">
    

    into something like that:

       <div class="toggle" id="displayText<?php echo $articles["id"] ?>_<?php echo $current_tab_id ?>_content">
    

    (of course $current_tab_id content the id of the tabs displayed)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay so here is the problem I am having. I have several unit tests
Okay so here is my database: I have a page on my .net form
Okay so here's my problem. I have a two global NSString variables. globalVariable1 //stores
Okay so here's the situation. I have this page of data. After the data
Okay here's my situation. I have the following branches development development-kirby (270 commits ahead
Okay here is what I'm trying to do: I have a model object that
Okay so here's, the scenario I have a thumbnail that contains an artists profile
Okay basically here's where I'm at. I have a list of PropertyDescriptor objects. These
Okay, here is my problem: Im implementing an algorithm in Java and part of
I may seem ignorant but I have not found much information about how to

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.