Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts

    hide content till full styles loaded

    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.

    http://www.anet.ro/cornel/etnoart/index.html

    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?
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #2
    New Coder
    Join Date
    Aug 2002
    Posts
    70
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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'.

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    Nashua, NH
    Posts
    1,724
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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...
    Vladdy | KL
    "Working web site is not the one that looks the same on common graphical browsers running on desktop computers, but the one that adequately delivers information regardless of device accessing it"

  • #4
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    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 ?

    ... 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?
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #5
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    ... 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 ). 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

    What about sites which use drop down menus?
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #6
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ... 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!"?
    Check out the Forum Search. It's the short path to getting great results from this forum.

  • #7
    Senior Coder
    Join Date
    Jun 2002
    Location
    Nashua, NH
    Posts
    1,724
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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)...
    Attached Thumbnails Attached Thumbnails hide content till full styles loaded-etno-ari.gif  
    Vladdy | KL
    "Working web site is not the one that looks the same on common graphical browsers running on desktop computers, but the one that adequately delivers information regardless of device accessing it"

  • #8
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    ...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...:-)
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #9
    Senior Coder
    Join Date
    Jun 2002
    Location
    Nashua, NH
    Posts
    1,724
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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
    Last edited by Vladdy; 09-26-2003 at 12:28 PM.
    Vladdy | KL
    "Working web site is not the one that looks the same on common graphical browsers running on desktop computers, but the one that adequately delivers information regardless of device accessing it"


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •