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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:13:51+00:00 2026-05-31T19:13:51+00:00

I have 2 div’s that I need consecutively toggled back and forth showing and

  • 0

I have 2 div’s that I need consecutively toggled back and forth showing and not showing. Here is my current jQuery code

$(document).ready(function(){

    $('a:link').click(function(){
    $(".surveycontainer").toggle();
    $("#check").toggle();
    });

});

Note #check is hidden on page load via CSS so this script says when a link is clicked each will be toggled, making the “surveycontainer” div disappear and the “check” div appear and vice versa.

The script works fine when calling a RSS feed within the surveycontainer (containing a link) and when clicked each div’s are toggled. The problem occurs when a plain link is placed in the div, when clicked the “surveycontainer” is hidden however “check” is not shown!

Surveycontainer code

<div class="surveycontainer" align="left">
<?php
// OFFERS

//Right here is a script that defines $country_code ("US" is what is called when the problem occurs)

<?php if($country_code=="US"): ?>
<a href="http://www.google.com" target="_blank">Yahoo</a>

<?php else: ?>
//Calls a RSS feed containing links here

</div>
<?php endif; ?>

As you can see if the $country_code equals “US” the Google link is called in a new window.

For some reason when the country code does not equal US and the data is pulled from the RSS feed the jQuery script above stands and each div is toggled when a link is clicked. However, when the Google link is used and clicked only the “surveycontainer” div is hidden and “check” is not shown.

I am in desperate need for a solution to this problem! Any help is greatly appreciated, thank you!!

  • 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-31T19:13:52+00:00Added an answer on May 31, 2026 at 7:13 pm

    place <?php endif; ?> before </div> it is not giving to end your surveycontainer div
    when condition for google link is satisfied. so re-writing your code will look like:

    <div class="surveycontainer" align="left">
       <?php
       // OFFERS
       //Right here is a script that defines $country_code ("US" is what is called when the problem occurs)
       <?php if($country_code=="US"): ?>
          <a href="http://www.google.com" target="_blank">Yahoo</a>
       <?php else: ?>
           //Calls a RSS feed containing links here
       <?php endif; ?>
    </div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It seems that in Firefox, if I have div A with fixed width/height and
I have outer div and inner div. I need to place inner div at
I have a div with a width of 200px. There is text inside that
I have a div in which I need a permanent vertical scrollbar. Sometimes the
I have div and buttons. .buttons size is not changing. (script.js is in the
I have div tag, I have a free text(on its own) in that tag.
In the aspx page I have div with id=progressBar and runat=server .I need to
I have next problem: There is jquery accordion control. One of tab have div
i have div's wrapped under div's my html code is. <div id=content-row> <div id=left-box>
I have div#myid that is resizeable with minHeight = 30px; I want to do

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.