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 7417343
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:40:59+00:00 2026-05-29T07:40:59+00:00

I currently have a jQuery code for 4 buttons. Basically you click the button,

  • 0

I currently have a jQuery code for 4 buttons. Basically you click the button, it loads the content ID for that area.

That code is

$("#theIntroduction, #theGoogleFeed, #theTwitterFeed, #theQuote, #contactUs").click(function ()
 {
    var container = $(this).attr('id')
    $(theCurrentPageHeader).hide();
    $('#'+container+'Content').show();
    theCurrentPageHeader = $('#'+container+'Content')
     return false;
 });

I’ve added a button of the id “close_btn”. What I’d like to do is click that button and it closes the content area.

I’ve been playing around with .hide and .show but the problem is once this is clicked, It either hides the content completely or displays the next in a block below the other.

This is what I had…

     $("#close_btn").click(function ()
 {
     $("#theIntroductionContent").show();
     $("#askMeAQuestion").hide();
 });

The HTML Markup that it runs against is as follows :

<div class="row <?php echo $personsImage ?>">
        <div class="span10">

          <h1 class="large primary" style="line-height:12px; margin-top:15px; margin-bottom:17px; margin-left:10px;"><?php 
            $pageTitle = get_the_title(); 
            if ($pageTitle == 'Personal')
            {
                echo 'Personal legal services';
            }else{
                echo $pageTitle;
            };

            ?></h1>
            <hr class="light" style="height:1px; margin-left:10px;" />
            <hr class="space" />
            <div id="theIntroductionContent" class="personInformationClass " style="display:none;"><div class="social introduction" style="float:left; padding:10px;"></div><p class="" style="line-height:24px; margin:0 60px;"><?php echo get_the_excerpt(); ?></p></div>
            <div id="theGoogleFeedContent" class="personInformationClass" style="display:none;"><div class="social google" style="float:left; padding:10px;"></div><p class="medium" style="line-height:24px;"><?php echo $googleNews ?></p></div>
            <div id="theTwitterFeedContent" class="personInformationClass" style="display:none;"><div class="social twitter_sub" style="float:left; padding:10px;"></div><p class="medium" style="line-height:24px;"><?php echo $twitterName ?></p></div>
             <div id="theQuoteContent" class="personInformationClass" style="display:none;"><div class="social quote" style="float:left; padding:10px;"></div><p class="medium" style="line-height:24px;"><?php echo $peopleDetails[3] ?></p></div>
             <div id="contactUsContent" class="personInformationClass" style="display:none;">
                <?php get_template_part('askMeAQuestion','index') ?>
             </div>

        </div>

         <div class="span6">

          <?php

            echo '<h1 class="large primary" style="line-height:12px; margin-top:15px; margin-bottom:17px;"><a href="'.$tempLink.'/people/'.$personsPermalink.'/" class="primary">' . $peopleDetails[0] . '</a></h1>';
            echo '<hr class="light" style="width:82%; height:1px; float:left; " />';
            echo '<p class="PersonTextClass"><!--strong>'.$peopleDetails[1].'</strong--></p>';
            echo'<p class="PersonTextClass small">Click the icons below to see whats going on and what we are talking about.</p><hr class="space" />';
            echo '<ul class="person_social_links">';
            echo '<li><a title=""class="social introduction" id="theIntroduction">Tilly Bailey & Irvine page introduction</a></li>';
            echo '<li><a title="Google News: '.$googleAlertsKeyword.'"class="social google" id="theGoogleFeed">Google alert</a></li>';

            if (trim($peopleDetails[4]) === "null")
            {

            }else{
           echo '<li><a title="Follow me on Twitter" class="social twitter_sub" id="theTwitterFeed">follow me on twitter</a></li>';
            }
            echo '<li><a title="Hi im '.$peopleDetails[0] .'" class="social quote" id="theQuote">my quote</a></li>';
            echo '</ul>';
            echo '<hr class="space" /><hr class="space" /><hr class="space" />';
            echo '<a class="medium footer_linkBox block askBtn" id="contactUs" style="color:#fff;">Ask '.$peopleDetails[0].'</a>';

?>


        </div>
    </div>

Is there any way I can incorporate the #close_btn to literally close the box that it resides and go to the previous box. Or the default page load which is #theIntroduction

  • 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-29T07:41:00+00:00Added an answer on May 29, 2026 at 7:41 am

    You could try something like this:

    $("#close_btn").click(function() {
    
       $("#theIntroduction").trigger("click");
    
    });
    

    I.e., on click of the close button trigger a click on the introduction link which should then execute your first function (which if I’m reading it correctly will do the hide and show for you)…

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

Sidebar

Related Questions

I currently have the following code that loads a UIWebView from another View. Now
This is the js code that i have currently <script src=jquery.js type=text/javascript></script> <script type=text/javascript>
Is there a better way to do this jquery code? Currently I have to
I currently have a click event in place that when selected appends a search
I have jquery code that is being reused by a repeatable partial view on
So I currently have a jQuery dialog with two buttons: Save and Close. I
I have 2 radio buttons that I currently check their value if is 6
I currently have an asp form that uses jquery for two elements: an image
I have 2 references to jQuery in my master page which is currently configured
I have a fancy web page with lots on JQuery included. Currently i am

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.