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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T16:05:16+00:00 2026-05-21T16:05:16+00:00

I’ve got a div that is hidden on page load and stretches to 100%

  • 0

I’ve got a div that is hidden on page load and stretches to 100% width via jQuery. Animation is great, but the content fluidly adjust until it’s container (which is within the stretchy div) reaches it’s full set width.

Previously the content didn’t shift and I can’t tell what changed that behavior after so many edits to the code! How can I fix the content from moving; showing as much as the resizing div allows without any movement? The specific problems are:

-#show_contact anchor drops below its two sisters until it has room to be on the same line
-#collections div’s margin:0 auto is affected by #show_contact’s short visit

Thanks!

P.S.- here’s what it looked like before/what I want it to look like now: http://jsfiddle.net/ZP86m/

HTML:

<div id="slider">
    <div id="trigger">
        <img class="arrow_small" src="images/left_small.png" alt="slide menu out" />
    </div>
    <div class="trans" id="overlay"></div>
    <div id="content">
        <div id="main_nav">
            <div id="nav_links">
                <div class="nav_link"><h3><a class="showlink" id="show_campaigns" title="Campaigns">CAMPAIGNS</a></h3></div>
                <div class="nav_link"><h3><a class="showlink" id="show_collections" title="Collections">COLLECTIONS</a></h3></div>
                <div class="nav_link"><h3><a class="showlink" id="show_contact" title="Contact">CONTACT</a></h3></div>
        </div>
            <div id="nav_container">
                <div class="nav" id="campaigns">
                    <p>CAMPAIGNS!</p>
                </div>
                <div class="nav current" id="collections">
                    <p>COLLECTIONS!</p>
                </div>
                <div class="nav" id="contact">
                    <p>CONTACT!</p>
                </div>
            </div>
       </div>
    </div>
</div>

CSS:

    #slider {
    width:100%;
    height:100%;
    top:0;
    right:0;
    float:right;
    position:absolute;
}
#overlay {
    width:100%;
    height:100%;
    position:absolute;
}
#content {
    width:100%;
    height:100%;
    position:relative;
    z-index:1;
}
#main_nav {
    width:684px;
    height:100%;
    margin:0 auto;
    padding:0px 30px 0px 30px;
}
#nav_links {
    width:100%;
    height:40px;
}
.nav_link {
    width:33%;
    float:left;
    margin:20px 0px 0px 0px;
    position:relative;
    text-align:center;
}
.nav{
    width:208px;
    height:100%;
    padding:20px 10px 20px 10px;
    margin:0 auto;
    text-align:center;
}

Javascript:

// Slide out menu
$('#slider')[0].style.width = '30px';
$(function() {
    $('#trigger').toggle(function (){
        $('#slider').animate({'width':'100%'}, 1500);
        $('.arrow_small').attr('src','images/right_small.png');
    }, function() {
        $('#slider').animate({'width':'30px'}, 1500);
        $('.arrow_small').attr('src','images/left_small.png');
    });
});
  • 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-21T16:05:17+00:00Added an answer on May 21, 2026 at 4:05 pm

    main_nav’s padding had to match the width of the animation of slider

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

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
Basically, what I'm trying to create is a page of div tags, each has
I've got a string that has curly quotes in it. I'd like to replace
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 want to count how many characters a certain string has in PHP, but
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a jquery bug and I've been looking for hours now, I can't
I have a small JavaScript validation script that validates inputs based on Regex. I
I am doing a simple coin flipping experiment for class that involves flipping a

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.