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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:44:54+00:00 2026-06-11T13:44:54+00:00

Basically, the overflow of a certain div in the page is set to scroll

  • 0

Basically, the overflow of a certain div in the page is set to scroll vertically. I want the user to be able to scroll immediately after the page loads. In order to scroll, at this time you must first click on that div and then you can scroll.

How can I make this happen straight away? I would kindly ask you to refrain from document.location.hash methods as this seems to be causing some other problems within pages for some reason.

If you look at the page, the scrollable div is #mainView.

Example page

  • 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-11T13:44:55+00:00Added an answer on June 11, 2026 at 1:44 pm

    Well, you can use window.scroll(). It even seems to be fairly well supported (IE9, Chrome, Firefox). IE8/7 I’m not so sure, since it doesn’t recognize the height: 100% on the html, body elements.

    For instance, here I will create twenty elements dynamically and set the window.scroll to the total height of the div, which in turn is (supposed to be) the same height as the document.body “height”.

    Try it out:

    (function load(d) {
        var body = d.body,
            i = 0,
            div,
            winheight = h(),
            scroll = 0;
    
        (function loop() {
            if (i++ < 20) {
                scroll = scroll + 20 + 100 + 5 + winheight;
    
                div = document.createElement('div'); 
                div.style.height = winheight - 125 + 'px';
                div.className = 'block';
                div.innerHTML = 'DIV #' + i;
    
                document.body.appendChild(div);
    
                window.scroll(0, scroll);
    
                setTimeout(loop, 2000);
            }
        })();
    
        function h() {
            return Math.max(
                Math.max(body.scrollHeight, d.documentElement.scrollHeight),
                Math.max(body.offsetHeight, d.documentElement.offsetHeight),
                Math.max(body.clientHeight, d.documentElement.clientHeight)
            );
        }    
    })(document);
    

    ​Demonstration (Source)

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

Sidebar

Related Questions

I basically have a div with set dimensions and overflow: hidden . That div
Ok so basically I have: <div style=overflow-x:scroll> <div class=content> <div class=text></div> <div class=seperator></div> </div>
Basically I want to check the extended permissions the user has granted my app.
basically I want to validate whether or not a text box is a certain
Basically I want to setup a tagging system like stack overflow has for entries
Basically I want to have that middle blue body part scroll minus the scrollbar
Basically I am trying to search the page when it loads for the string
Basically, i am trying to create a web page that utilises jquery in order
Basically I want to convert a virtual path to an absolute path.
Basically I have a large set of data in excel, and I was wondering

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.