Eliminate "Flash of ugly" on the asmiller gallery?

Permalink
I love the asmiller gallery more than I can express, but on this current website, it's showing a "flash of ugly" before it loads. I don't really know what is different about this site than any others. I've never had this problem before:

http://bymc.pairserver.com/fifthseason/index.php/residential/projec...

any way to just HIDE that crap until it's all loaded?

 
Stiny replied on at Permalink Reply
Stiny
You may want to try this javascript:

Inside the css for that gallery you want to hide, slip in "visibility: hidden;" like so:

#gallery {visibility:hidden;}


Then you will want to make an external javascript file with this script:

var aDOM = 0, ieDOM = 0, nsDOM = 0; var stdDOM = document.getElementById;
if (stdDOM) aDOM = 1; else {ieDOM = document.all; if (ieDOM) aDOM = 1; else {
var nsDOM = ((navigator.appName.indexOf('Netscape') != -1)
&& (parseInt(navigator.appVersion) ==4)); if (nsDOM) aDOM = 1;}}
function xDOM(objectId, wS) {
if (stdDOM) return wS ? document.getElementById(objectId).style:
document.getElementById(objectId);
if (ieDOM) return wS ? document.all[objectId].style: document.all[objectId];
if (nsDOM) return document.layers[objectId];
}


This code basically provides the instructions on how to identify objects and define them across multiple browsers.

Make sure you link to the js file in the <head> area:

<script type="text/javascript" src="animhead.js">
</script>


Then, inside the <head> code, insert the following (make sure "gallery" actually matches the id name you are using):

function start() {
setObjVis('gallery','visible');
}
window.onload = start;


There you go! Hopefully this works for you.
zoinks replied on at Permalink Reply
Thanks, man! I wonder if I can add this Javascript to the view.php file of the asmiller gallery since there's already some javascript at the top (and I'm not sure where else to put it). Guess I'll try that.

So many freakin' geniuses in this community, I can only hope it will eventually rub off on me. Learning PHP and Javascript simultaneously is slow-going for me to say the least, but I'm a lot better now than I was last year at this time.
Stiny replied on at Permalink Reply
Stiny
Hey, you'll get it in no time. The key is to immerse and push yourself.

About the external javascript, you could put it into a *.js file and put it into your /theme folder outside /concrete. Then link to it in header.php.

Just so you know, the code above is not all mine. I got a bit of guidance from CNet. Just remember, Google is your greatest ally. :)
zoinks replied on at Permalink Reply
by the way, it didn't work. what happened instead was the Flash of Ugly appeared and remained permanent, without EVER going to a normal gallery state. I decided a flash of ugly was the lesser of the two evils.