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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:51:35+00:00 2026-06-13T02:51:35+00:00

Here I have a div in a right sidebar that supposed to act in

  • 0

Here I have a div in a right sidebar that supposed to act in this way:

1) When you scroll down the page and div reaches the top of the browser screen, it’s class changes and it will get fixed on top of the screen untill you reach to the bottom of div’s parent element.

2) Once the bottom of div reaches the bottom of parent element, it’s class changes back to non-fixed position.

Here is the jsfiddle for you to play with http://jsfiddle.net/comparebest/z2Nyn/1/

Now to the problem:

For some reason in FireFox once div reaches the bottom of parent element, div disappears, while in Chrome, IE and Safari it stays visible.

You might need to make the size of your browser screen smaller in order to observe this behavior.

How can I prevent div from disappearing in FF?

P.S:

Heres the jQuery code:

    function fixInParent(selector) {
    var $el = $(selector);

    $(window).scroll(function() {
        if($el.parent().offset().top > $(this).scrollTop())
            $el.addClass('top').removeClass('floating').removeClass('bottom');
        else if ($(this).scrollTop() + $el.height() < $el.parent().offset().top + $el.parent().height())
            $el.addClass('floating').removeClass('top').removeClass('bottom');
        else
            $el.addClass('bottom').removeClass('top').removeClass('floating');
    });
}

$(document).ready(function() {
    fixInParent('#floater');
});​
  • 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-13T02:51:36+00:00Added an answer on June 13, 2026 at 2:51 am

    the problem is Firefox’s support for relative positioning on table-cells. See: Does Firefox support position: relative on table elements?

    Your fix:
    Apply position:relative to the containing <table> tag, so that the table is the positioning context, instead of the cell.

    This should work in your situation because you only have one row of cells, and they have the same bottom as the table. I was able to get this to work on your site in Firebug; though not in your fiddle, because in that example, the cell is not aligned with the table bottom.

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

Sidebar

Related Questions

Here I have a div on the bottom of right sidebar that supposed to
I have two div columns sidebar(left) and page-content(right). I toggle removing and adding 'sidebar'
I have a page with a float: right 'ed div at the top, and
I have a div (class=sidebar) that I want to display on the right hand
I have a div that contains 3 fields You can see the image here
I have a div tag which looks something like this: <div id=some id here
I have a div class='messages'. I add date to this div via jQuery.append() Here
I have this div in my code: <div id=advice class=validation-advice style=>some text here</div> Now,
I have this code here, {foreach from=$cart.cartItems item=item name=cart} <div id=cart2Produkt> <p>{if $item.Product.ID} <a
I have a page that has three divs one at the top, one at

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.