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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T22:31:26+00:00 2026-05-15T22:31:26+00:00

I’m trying to animate something using jQuery. UPDATE I have it working the way

  • 0

I’m trying to animate something using jQuery.

UPDATE

I have it working the way I want it. This is the jQuery:

    $(document).ready(function() {

        // go chat button
        $('#go-chat input').click(function() {
            $('#search, #go-chat').animate({width: '0px'}, 1000, function() {
                    $(this).hide();
                    $('#login, #go-search').animate({width: '573px'}, 1000, function() {
                            $(this).show();
                        }
                    );
                }
            );
        });
        $('#go-search input').click(function() {
            $('#login, #go-search').animate({width: '0px'}, 1000, function() {
                    $(this).hide();
                    $('#search, #go-chat').animate({width: '573px'}, 1000, function() {
                            $(this).show();
                        }
                    );
                }
            );
        });
    });

The problem now is that the text is wrapping as the slide happens and it is very ugly. How could I make it so that the text slides in/out as the search bar and the input fields without it wrapping as the width narrows/expands?

Thanks.

OLD QUESTION

Basically, I want to slide in the search bar to the left, essentially hiding it, and then slide out the 4 inputs below it. For now, I’ve placed them under the search bar but my plan is to hide them, and when the “Go Chat” button is pressed, the search slides out to the left and the 4 inputs slide in to the right.

Right now, the search box slides in to the center and doesn’t disappear fully. How can I make it so it functions as I want it? If my explanation is unclear as to what I’m looking for, please ask for clarification.

Thanks.

  • 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-15T22:31:27+00:00Added an answer on May 15, 2026 at 10:31 pm

    I figured it out. To make it slide to the left, I gave the corresponding surrounding <div>s a width and margin-left: 0px;. Then I had the issue of the text wrapping as the width narrowed/widened. To fix that, I added white-space: nowrap; to the CSS for the corresponding <div>s.

    Here’s the jQuery:

    $(document).ready(function() {
        $('#go-chat input').click(function() {
            $('#search, #go-chat').animate(
                {
                    width: '0px'
                }, 1000, function() {
                    $(this).hide();
                    $('#login, #go-search').animate(
                        {
                            width: '573px'
                        }, 1000, function() {
                            $(this).show();
                        }
                    );
                }
            );
        });
        $('#go-search input').click(function() {
            $('#login, #go-search').animate(
                {
                    width: '0px'
                }, 1000, function() {
                    $(this).hide();
                    $('#search, #go-chat').animate(
                        {
                            width: '573px'
                        }, 1000, function() {
                            $(this).show();
                        }
                    );
                }
            );
        });
    });
    

    … and the CSS:

    #search {
        border: 1px solid #999999;
        -moz-border-radius: 5px;
        width: 573px;
        height: 40px;
        margin: auto;
        margin-top: 100px;
        margin-left: 0px;
        position: relative;
    }
    
    #go-chat {
        width: 575px;
        margin: auto;
        margin-top: 36px;
        margin-left: 0px;
        padding-top: 5px;
        white-space: nowrap;
    }
    
    #login {
        border: 0px;
        width: 0px;
        display: none;
        margin: auto;
        margin-top: 100px;
        margin-left: 0px;
        position: relative;
    }
    
    #go-search {
        width: 0px;
        margin: auto;
        margin-top: 36px;
        margin-left: 0px;
        padding-top: 5px;
        white-space: nowrap;
        display: none;
    }
    

    If anyone has suggestions on the way I formatted the jQuery, please let me know what you think… do you like the way I formatted? I feel like it looks a bit awkward.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I am reading a book about Javascript and jQuery and using one of the
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I want to construct a data frame in an Rcpp function, but when I
I have thousands of HTML files to process using Groovy/Java and I need to
I am trying to loop through a bunch of documents I have to put

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.