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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:38:45+00:00 2026-06-15T16:38:45+00:00

jquery scrollToFixed stopped when it reached the very top of the page, and it

  • 0

jquery scrollToFixed stopped when it reached the very top of the page, and it just appears on top of the div that is suppose to be fixed at the very top.

Here is what I have so far.

var arr = new Array();
$('div[id^="post"]').each(function()
{
   // do something with it...
    var id = $(this).attr("id").slice(5);
    //alert(id);

    arr.push(id);

   $(this).css('background-color', 'green');
});

     for (i = 0; i < $('div[id^="post"]').length; i++) {
      //alert(arr[i+1]);

            $('#float-'+arr[i]).scrollToFixed({
        limit: $('#post-'+arr[i+1]).offset().top - $('#float-'+arr[i]).height()-220
    });
    }​

I am using the jquery scrollToFixed plugin.

I am trying to achieve the same effect on 9gag.com, scroll multiple sidebar divs down t he screen, I got the idea here.

When you scroll the page, the right div should become fixed until the end of the left div is reached, but for some reason, the right div become fixed at the very top of the page, I have the top(ad and navigation) div set to fixed all the time.

  • 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-15T16:38:46+00:00Added an answer on June 15, 2026 at 4:38 pm

    If I understand you correctly then what is happening is expected. The jQuery plugin (scrollToFixed) doesn’t know that you want the element positioned beneath another one so you’re going to have to do that yourself.

    The easiest way is to give #float-63 (imo not a very good ID) a margin-top that equals the height of the element it should be positioned below. 70px seems to work fine.

    The problem with this is that it will have 70px margin-top even when it’s not “fixed”. It doesn’t seem that the plugin adds any sort of class to the element when it goes fixed but that should be pretty easy to add if you know jQuery.

    Then you can simply do #float-63.scroll-to-fixed {margin-top: 70px}

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

Sidebar

Related Questions

jQuery Mobile 1.1.0 Final was just released and promises: True fixed toolbars: Lightweight, CSS-based
JQuery events are annoying me. The thing is that I very often use javascript
I have just used the ScrollToFixed plugin by bigspotteddog ( https://github.com/bigspotteddog/ScrollToFixed ) on my
jQuery recommends CDN hosted or self hosted jQuery library. Here is the download path
JQuery-ui will generate a div with a calendar-div class. Sadly this div is no
i'm having a problem using the scrolltofixed jquery plugin https://github.com/bigspotteddog/ScrollToFixed i use: $('#tostick').scrollToFixed({ limit:
Is there a jQuery plugin, or other JS library, for making certain elements have
jQuery's deferred's have never liked me, and I've never been fully able to understand
jquery attaches a click method on even things that aren't typically clickable like a
jquery update breaks when jquery, itself update input value!! i have some input boxes

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.