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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T13:01:06+00:00 2026-06-12T13:01:06+00:00

I have some jquery I wrote and the top half works fine for the

  • 0

I have some jquery I wrote and the top half works fine for the animation.

An example of the animation can be found here (scroll down to About section and Click ‘+’: http: damon9.com/dev/DC/index38.php

I’ve tried multiple combinations of if/else statements to find if one of the elements is visible run this function, etc. I need it to go back and forth. I’m kind of new to jquery, but any help would be appreciated. Thanks.

html:
<div class="info-box" id="about-box">
  <div class="info-control"> 
    <!-- end .info-control --></div>
  <div class="button-area">
    <div class="open-close-btn" id="oc_about">
      <h2>+</h2>
      <h3>_</h3>
    </div>
    <!-- end #open-close-btn -->
    <p id="open-about">Open</p>
    <p id="close-about">Close</p>
  </div>
  <!-- end .button-area -->
  <header>Damon</header>
  <p class="info-title">Who I am and what I do</p>
  <p class="info-title">oijawoijriaejriejwirjw wr aweo  aw oewi jwo ijew oiweaj iwe </p>
</div>
<!-- end .info-box --> 

css:
.info-box {
background-color: #000;
width: 410px;
height: 100px;
opacity: .75;
position: absolute;
z-index: 60;
overflow: hidden;
}

.info-box header {font-family: 'GeosansLightRegular';
font-size: 42px;
color: #82da9b;
font-weight: 100;
letter-spacing: 1px;
padding: 6px 10px 0px 12px;
margin: 0;

}
.button-area {float: right; width: 180px; height: 50px;  position: relative; padding:     10px 10px 0 0;}

.button-area p {float: right; font-size: 13px; color: white; font-family: 'GeosansLightRegular';letter-spacing: 1px; padding: 4px 0 0 0; margin: 0;}

.open-close-btn {background-image:url(../images/open-close.png); position: relative; width: 53px; height: 53px; z-index: 70; float: right; display: block; cursor: pointer;  }

.open-close-btn:hover {background-position:0 -53px; cursor: pointer;}

.open-close-btn:active {background-postion:0 -106px; cursor: pointer;}

#oc_about h2{font-family:"Trebuchet MS", Arial, Helvetica, sans-serif; font-weight: 100; font-size: 40px; color: white; text-shadow: 3px 3px 2px #000 inset; margin: -2px 0 0 2px; display: block;}

#oc_about h3{font-family:"Trebuchet MS", Arial, Helvetica, sans-serif; font-weight: 100; font-size: 30px; color: white; text-shadow: 3px 3px 2px #000 inset; margin: -6px 0 0 4px; position: absolute; display: none;}

.button-area #open-about{display: block;}

.button-area #close-about{display: none;}

js:
if ($('.button-area #open-about').is(':visible')) {// if ID exists

    $("#oc_about").click(function () {
    $("#oc_about h2").fadeOut("fast" , function () {
    $(".button-area #open-about").fadeOut("fast" , function () {
    $("#oc_about h3").fadeIn("fast" , function () {
    $(".button-area #close-about").fadeIn("fast" , function () {
    $("#about-box").animate({height:"2000px" , paddingTop: "500px", marginTop: "-500px"}, 500);
                    });
                });
            });
        });
    });

    }

    else {
     $("#oc_about").click(function () {
$("#oc_about h3").fadeOut("fast" , function () {
$(".button-area #close-about").fadeOut("fast" , function () {
$("#oc_about h2").fadeIn("fast" , function () {
$(".button-area #open-about").fadeIn("fast" , function () {
$("#about-box").animate({height:"100px" , paddingTop: "-500px", marginTop: "500px"}, 500);
                    });
                });
            });
        });
    });

     }
  • 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-12T13:01:07+00:00Added an answer on June 12, 2026 at 1:01 pm

    The sequence is wrong. The if/else should inside click:

    $("#oc_about").click(function () {
        if ($('.button-area #open-about').is(':visible')) {
            $("#oc_about h2").fadeOut("fast" , function () {
                $(".button-area #open-about").fadeOut("fast" , function () {
                    $("#oc_about h3").fadeIn("fast" , function () {
                        $(".button-area #close-about").fadeIn("fast" , function () {
                            $("#about-box").animate({height:"2000px" , paddingTop: "500px", marginTop: "-500px"}, 500);
                        });
                    });
                });
            });
        } else {
            $("#oc_about h3").fadeOut("fast" , function () {
                $(".button-area #close-about").fadeOut("fast" , function () {
                    $("#oc_about h2").fadeIn("fast" , function () {
                        $(".button-area #open-about").fadeIn("fast" , function () { 
                            $("#about-box").animate({height:"100px" , paddingTop: "-500px", marginTop: "500px"}, 500); 
                        });
                    });
                });
            });
        }
    }); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having some issues with a jQuery AJAX call. My code works fine when
I have some jQuery code like this : $(function($) { $('input.autonumeric').autoNumeric({aSep: ',', aDec: '.',vMax:'1000000000000'});
I have some jQuery tabs on a website and I am trying to make
I have some jquery which will calculate the items in my menu and assign
I have some jquery code that is doing an ajax lookup and returning comma
I have some jquery/php interaction set up on a page. It submits some data
I have some jQuery code that highlights a link when clicked, and changes the
I have some jquery code which I am trying to translate to YUI. I
I have some jQuery/JS below. The first thing to run is the alert box
I have some jQuery code that intercepts links clicked on a page: $(document).ready(function() {

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.