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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:05:17+00:00 2026-05-17T23:05:17+00:00

I’m trying to understand this conflict between My loadingbarscript that hides my content until

  • 0

I’m trying to understand this conflict between

  1. My loadingbarscript that hides my content until the page is loaded (Removed the tags from the top)

    function showContent(){
         //hide loading status...
         document.getElementById("loading").style.display='none';
         //show content
         document.getElementById("content").style.display='block';
      }
      window.onload = function() {
     showContent(); }
    </head>
    <body>
    <script type="text/javascript">
      document.write('<div id="loading"><img src="ajax-loader.gif"></div>');
    </script>
    <div id="content">
      <script type="text/javascript">
         //hide content
         document.getElementById("content").style.display='none';
      </script> 
    

And 2. My livepipe scrollbar using prototype 1.6.1
Where the call is this:

  <script type="text/javascript">
      document.observe('dom:loaded',function(){     
        var scrollbar = new Control.ScrollBar('cases_tekst','scrollbar_track');
            });
    </script>

For some reason either one works or they other depending on the order. I had several other windows.onload functions that work with the prototype scrollbar but not this one.
Hope to understand better what is turning wrong. No errors show up with firebug.
The mistake must have something to do with the onload call because when i resize my browser window the scrollbar works.

Hope someone can explain the cause of the conflict.

  • 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-17T23:05:18+00:00Added an answer on May 17, 2026 at 11:05 pm

    Instead of using window.onload to call showContents, use prototype’s Event.observe function. Like this:

    Event.observe(window, "load", showContent);
    

    For more info on this function: http://www.prototypejs.org/api/event/observe

    For more info on why not to use the window.load event model, check out this site: http://www.quirksmode.org/js/introevents.html

    In general, quirksmode.org is a great site for understanding this kind of thing and how they behave in various browsers. That’s one of the reasons to use libraries such as prototype or jquery as it standardizes much of the browser’s behavior.

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

Sidebar

Related Questions

No related questions found

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.