View Full Version : hide content till full styles loaded

09-24-2003, 11:10 AM
I've made an independent positioning of some objects (using screen.availWidth and screen.availHeigth) and I used styles on the fly to rollover and show/hide objects.


Now, according to the connection, there is a time when all the objects are shown alltogether in the top/left corner, before the styles are loaded. I want to avoid that. Can I delay the loading of the content till the entire script (the styles) is loaded? Shall I use a progress bar or something similar?

09-24-2003, 05:22 PM
You could insert all of your content inside of a div tag initially set to 'hidden' and then have an onload function that sets the visibility to 'visible'.

09-24-2003, 05:48 PM
You need to change your design approach.
Have you tried to run your page with JS disabled? It does not work.
Make sure you have functional page without using JS and styles, then add additional bells and whistles. As a result your problem will go away, since you will be able to move initialization of your JS related effects to body onload.
You do not need JS for your menu rollovers anyway...

09-25-2003, 09:06 AM
Thanks for advices, you both give me some good hints.

You might be right, Vladdy, but I don't intent to work for those who disable their javascript. Noone produces mute movies these days for those who want to cover their ears... Anyway, they are very very few, so I don't care if they don't see my page.

I even intend someday to insert a sarcastic alert in <noscript> for those who disable Javascript...

After all, I earn my money even by doing javascripts, so why think about those who don't need my work ? :D

... It seems a litle bit unfair... Modern browsers are Flash plug-in incorporated, so there is no "Flash disable" available... Why, on earth, the "javascript disable" is still there?

09-25-2003, 09:41 AM
... I don't argue with you, Vladdy. After all, you are right, we have to do our best to build something full cross-browser, I know.

Yet, sometimes, the marketing issues come overall. Sometimes the client wants something which is either impossible to cross-browser or will earn a lot of time to make it cross-browser (but the client wants always to be ready tomorrow :D ). Other times, they really want to have something for special purposes (I had a client who wanted something to fit 1024-768 only, and didn't give a damn about other resolutions, even about anything else that IE 5.5+ )

In my case, client wanted that intro to be positioned aprrpox in the middle of the page, x and y, no matter of resolution, so I have no choise than to use javascript and styles on fly... So, you see, it was not the rollover toy I use JS for...:-)

The rest of the site (I mean the first menu button's link, it was already made by someone else, using a lot of JS too... So, think a little... Why worry about JS disable if I have to include other parts made by someone else with no such a worry.

See now, things are nit a simple as you put them in theory :D

What about sites which use drop down menus?

Roy Sinclair
09-25-2003, 03:44 PM
... It seems a litle bit unfair... Modern browsers are Flash plug-in incorporated, so there is no "Flash disable" available... Why, on earth, the "javascript disable" is still there?

You know, I've asked MS more than once for a "Flash Disable". More specifically, I've asked them to allow me to say stop asking me if I want to install Flash just because I hit another web site using it (or more common, a web site with an advertisement using it). How many times do I have to say "NO, I don't want Flash!"?

09-25-2003, 04:01 PM
If the customer does not understand what web is and how it works, you should educate him/her. Not only it will make your job simpler in the long run, but will also result in a better product. Doing just "what customer wants" may seem as an easy way out, but it's not. You need to undersdand WHY they want it and then show them alternative ways of achieving it or explain that the negative imact of certain features makes it not worth implementing them.
In your case, why do you need to actively position every single element with JS, when you can use CSS to position all your elements within a block element, then use margin: 0px auto; to center that block horizontally and then if JS is available add the top margin to give you vertical centering.
BTW I'm attaching the gif of what it looks like in Gecko, do not think that is the way you want it to come out (do not mind the colors, I had to bring the file size down)...

09-26-2003, 09:37 AM
...Anyway, I decided to change the intro, including even some of your advices. I'll use fonts instead of pictures for buttons.

The main problem... I've solved it in another way (but if javascript disbled, there will some problems also) by giving CSS visibility:hidden to all the layers, from the begining (just a temporary solution).

In Europe (and in Central&Estern Europe especially) the main browsers are IE5.5+ and NS6+ (covering over 98%), and the main used resolutions are 1024x768 (over 55%) and 800X600 (about 40%). The main OS are Microsoft products (over 80% - e notable exception is Sweden with a large number of Mac prods).

Looks normal for all of us to optimize our products to the market's parameters...

See now that, as most all my products are designed for a specific market, I don't even bother to install Mozilla, Gecko or even Opera for testing my web pages. If I would have work in the USA & Canada probably I should do otherwise...:-)

09-26-2003, 01:25 PM
Originally posted by Kor
Looks normal for all of us to optimize our products to the market's parameters...

When it comes to web, "market parameter" change fast. The web as we know it was "born" only ten years ago.

Designing for "current" market condition puts you behind fron the get go, especially considering the current trend of user agents expansion into PDAs cell-phones etc. Therefore such design is set to start losing market the day it is released.

What makes sense is to code looking into the future, unless constant site updates is your job security :D :D :D :thumbsup: