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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T05:54:01+00:00 2026-06-09T05:54:01+00:00

The code works fine. jsFiddle The only problem is that it changes its width

  • 0

The code works fine.
jsFiddle

The only problem is that it changes its width when slides (when press “click here”). Seems like it cuts the width that corresponds to 100px of the margin-left in #slider.

Why does it “jump” and how to fix it? Is there anything wrong with the code?

What is in there: a slider of the centered div that has a content and a sticky footer.

  • 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-09T05:54:03+00:00Added an answer on June 9, 2026 at 5:54 am

    Not sure if it fits your needs, but you can simply set :

    CSS

    ...
    
    .slider{
    
        ...
    
        bottom:0px;
    
        ...
    
    }
    

    and then simply use jQuery .slideToggle() which will handle the open/closed statuses and is much more smooth:

    JS

    $("#slide-link").click(function (){
    
        $('#slider').slideToggle();
    
    });
    

    here’s a sample jsFiddle

    EDIT 1

    Updated this so that #slide-link toggles too with #slider.

    Basically what we do is animate it based on whether #slider is hidden or not:

    if(!$('#slider').is(':hidden')){
    
        $(this).animate({
    
            top: $('#global-container').height()-23
    
        },500)
    
     }else{
    
        $(this).animate({
    
            top: '0px'
    
        },500) 
    
     }
    
    • JSFIDDLE HERE

    EDIT 2

    Here’s another more hacky way for not having to deal with that if(#slider is hidden) thus writing the .animate function only once.

    Basically $(‘#slider’).is(‘:hidden’) is a boolean and in JS booleans are equivalent to 0/1 values where false = 0 and true = 1, thus you can write:

    var hid = $('#slider').is(':hidden')
    
    $(this).animate({
    
        top: (1-hid)*(contHeight)
    
     },500)
    

    Where contHeight is the #global-container height – #slide-link height.

    • JSFIDDLE HERE

    EDIT 3 Scroll Issue

    If I got your problem in comment right, when you fill up the content part with allot of words id doesn’t scroll, but the content panel seems to fill the wole #slider and continue out the page without being able to scroll it.

    This is due to the fact .content has not a fixed height, this is because we know the footer is 70px high, and simply we want the .content to fill up all the space left inside the #slider, but this way .content doesn’t have a “fixed value” i.e. inside its css there’s no definition for its height. So what we need to do is dynamically tell him how hight it has to be just the way we do it with #slide, so add in the JS

    $('.content').height(contHeight-70)
    

    this way you can now add:

    overflow:hidden; //this is to prevent orizontal scroll
    overflow-y:scroll; // this enables vertical scroll
    

    Hope I got this right.

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

Sidebar

Related Questions

Here is a jsFiddle code that works fine if no Twitter widget was inserted
This code works fine here http://jsfiddle.net/LH7sy/11/ It tries to find sml( and )sml in
Currently I have a piece of code that works fine as long as there
I wrote this code and it works fine when there's only 2 menus, but
This code works fine in Chrome. However, in Firefox, when it hits the GMxhr
This code works fine, but I'll want to handle exception if any thing goes
this code works fine until I start scrolling: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
This code works fine to find an available room within certain date, but it
This code works fine in C#: Expression.Lambda(LambdaBody); But none of the methods for building
My code works fine when I call AA.sendRequest() from the console, but not when

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.