...

View Full Version : How do you not show page contents while script is executing?



MrBiggZ
06-24-2010, 04:32 PM
Greetings!

Since the birth of CSS3 you can easily use fonts that are NOT on the local users PC. This is the best! Although some fonts do not render through the browser. I wrote this script (for personal use) which is pretty elementary which reads fonts in a directory (without installing them in windows) and then lets you display them in various web aspects.

In the script I pick a random background color and calculate a contrast color and then determine if the text color should be black or white depending on the color of the background.

What's happening is that if I pile a bunch of fonts in the fonts directory when the script executes it displays the contents until it 100% complete. Basically I'd like it NOT to do that. I was looking around a progress bars but .. they don't seem to do much. I couldn't find one that would either give you that twrilling circle while it loads or something to that nature.

**Is you test this script you MUST create a folder named 'fonts' in the root of where you put the script!

***If you find ways that I can make this more effecient or any tips or tricks that'd be great and constructive criticism is always appreciated!

Thanks so much for any help or advice given!

You'll need the javascript file animatedcollapse.js from my site http://handlersspot.net/css3font/animatedcollapse.js

There's are three images:
http://handlersspot.net/css3font/slantdivider.gif
http://handlersspot.net/css3font/minus.png
http://handlersspot.net/css3font/plus.png

I tried to post the source here but it seems that I used up my allotment of 20K characters :eek: I tried to use the attachments feature but it doesn't work for me for some reason so I posted all the source here on my website: http://handlersspot.net/css3font/source.html

Whew! That's allot of stuff! :D

Again .. thanks for the effort/advice/help way in advance!

Oh! Sorry! Meant to put the actual working version of this here --> http://handlersspot.net/css3font

Rowsdower!
06-24-2010, 04:43 PM
Is this a javascript question?

MrBiggZ
06-24-2010, 06:20 PM
Is this a javascript question?

Not really sure the scope of what javascript can do. Can it tell when the page is done building?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum