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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T18:10:05+00:00 2026-06-06T18:10:05+00:00

When I load my page or when I resize the browser window, the css

  • 0

When I load my page or when I resize the browser window, the css has a load delay and the user can see the page without formatting. This is my site: bit.ly/MbyWss

This is my code:

My original css in html is estilos_def.css

<body id="body" onresize="start();" onload="start();">

when body is loaded or resized i call the function start

var navWidth, navHeight;
function start(){

    if (self.outerWidth != undefined)
    {
        navWidth = self.outerWidth;
        navHeight = self.outerHeight;
    } else {
        navWidth = document.documentElement.clientWidth;
        navHeight = document.documentElement.clientHeight;
    }
    //Problema com deteçao de width, resolve-o

    if(navWidth>=1600){ //1600 - 1920
        document.getElementById("estA").href="style/estilos_ws.css"
        document.getElementById("titulo_dias").style.height= "10%";

    }else if(navWidth > 1300 && navWidth <1600){ //1300 1600
        document.getElementById('estA').href="style/estilos_1920.css";
        document.getElementById("titulo_dias").style.height= "7%";

    }else if(navWidth >= 1024 && navWidth <=1300){ //1024 - 1280
        document.getElementById("estA").href="style/estilos_def.css"
        document.getElementById("titulo_dias").style.height= "7%";

    }
    lbeats();

    if(navigator.appName =='Microsoft Internet Explorer')
    {
        ie();
    }
    document.getElementById("dias").style.display="none";
    document.getElementById("gal").style.display="none";
}
  • 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-06T18:10:06+00:00Added an answer on June 6, 2026 at 6:10 pm

    I believe that you could probably do everything in css without any code…

    But if that is a must for some reason, pre-load all css files on page open, remove them from the page and on resize re-add the needed one which will be used from the cache not downloaded.

    Another approach would be to keep all the styles in one css file and make all the styles in each one of them binded to some class name assigned to body for example, like this:

        /* Sheet 1*/
        .bodySheet1 div.Main {}
        .bodySheet1 .img1 {}
    
        /* Sheet 2*/
        .bodySheet2 div.Main {}
        .bodySheet2 .img1 {}
    
        /* Sheet 3*/
        .bodySheet3 div.Main {}
        .bodySheet3 .img1 {}
    

    and instead of activating each sheet, just assign the body the correct className

    I still believe that you don’t need to do this at all, you can probably do it all in pure css without any tricks.

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

Sidebar

Related Questions

UPDATE: I added this to my unload function: $(window).resize(function(){ var pageheight = $(window).height(); $('section').css('height',
I want resize browser window to 1000x700 pixel by default on load of html
Hello can anyone help? I am using this full page slider.. http://www.musca.se/full-window-width-jquery-tools-content-slider-demo/ However i
On page load I'm bootstrapping my data to my collections via this technique .
I've got some code to maximize a video panel on page load / resize.
I have an image that I want to resize after page load to fit
I have a small function that runs on load and window resize.. but the
Possible Duplicate: JQuery: $(window).resize() doesn't work on Load I have the below jQuery function.
I'm trying to load page and then remove some elements in it. While doing
Is Page.Load the earliest point in the Page.Load life cycle to add Response.AppendHeader?

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.