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

  • Home
  • SEARCH
  • 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 1008153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T08:43:41+00:00 2026-05-16T08:43:41+00:00

I’m looking for a solution to keep an element in view, while scrolling the

  • 0

I’m looking for a solution to keep an element in view, while scrolling the rest of the page.

I don’t want to re-invent the wheel so i’m reaching out to see if the community knows of a canned solution already.

I want to apply this to a huge table that I have, and I would like users to be able to continue seeing the table headers as they scroll down.

Just to clarify, what I’m looking for is different from a scrollable table with overflow CSS settings. The reason I can’t use a scrollable table is because that method becomes very slow with thousands of rows. Also that method does not work well on the iPhone browser.

Ideally I would like it so that when the user scrolls the page down the table’s header would ‘stick’ at the top edge of the browser’s view. Inversely if the user scrolls back up it would continue to stick there until it arrives back at the original position the header started from.

  • 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-16T08:43:42+00:00Added an answer on May 16, 2026 at 8:43 am

    Are you looking for the #element { position: fixed; ... }? You can switch between fixed, relative and absolute using JS.

    http://www.w3schools.com/cssref/pr_class_position.asp

    Edit

    Take a look at how they do it on [I hope they don’t mind] http://www.zocdoc.com/search.aspx?dr_specialty=98&address=Enter+a+City+and+State%2C+or+Zip&insurance_carrier=-1&insurance_plan=-1&button.x=166&button.y=21

    They use jQuery, it doesn’t seem complicated and they also has an IE6 workaround

    $(function() {
        var msie6 = $.browser.msie && $.browser.version < 7;
        if (!msie6) {
            var top = $('#scroll_header').offset().top
                    - parseFloat($('#scroll_header').css('margin-top').replace(
                            /auto/, 0));
            $(window).scroll(function(event) {
                var y = $(this).scrollTop();
                if (y >= top) {
                    $('#scroll_header').addClass('fixed');
                } else {
                    $('#scroll_header').removeClass('fixed');
                }
            });
            var y = $(this).scrollTop();
            if (y >= top) {
                $('#scroll_header').addClass('fixed');
            } else {
                $('#scroll_header').removeClass('fixed');
            }
        } else {
            setInterval("checkScroll()", 100);
        }
    });
    function checkScroll() {
        ie6top = $('#scroll_header_wrapper').offset().top;
        if ($(document).scrollTop() > ie6top) {
            $('#scroll_header').css("top", $(document).scrollTop() - ie6top + "px");
            $('#scroll_header').css("visibility", "visible");
        } else {
            $('#scroll_header').css("visibility", "hidden");
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to select an H1 element which is the second-child in its group

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.