PDA

View Full Version : DHTML Window widget (v1.1) cause a white background flash



scubajoe
10-31-2008, 12:28 AM
Hi all!

DHTML Window widget (v1.1) cause a white background flash

the dhtmlwindow.js seems to be the source of the problem.

http://www.dynamicdrive.com/dynamicindex8/dhtmlwindow/index.htm

anyone had that problem ?

on http://www.wakooz.com change the language to see what i mean

Cheers

Sam

jscheuer1
10-31-2008, 07:32 AM
Only seems to happen in IE. However, it appears you have a script error:


Error: document.getElementById(d) is null
Source File: http://www.wakooz.com/scriptstyles/index.js
Line: 185

This may or may not be related (code from the error in index.js):


// Hide and Show Divs
function HideContent(d)
{
if(d.length < 1) { return; }
document.getElementById(d).style.display = "none";
}


I would assume you are passing a string (the id of the element to hide), but this test only protects against an empty string. What about the case (as evidenced by the error) when there is a string but no element with that id? I would do:


// Hide and Show Divs
function HideContent(d)
{
if (d.length < 1)
return;
else if (document.getElementById(d))
document.getElementById(d).style.display = 'none';
}


Fix that, cross your fingers, and hope that takes care of your problem. If not, let us know.

scubajoe
10-31-2008, 11:03 PM
Hi John

Made the modification acroding to your direction but
it did not work

the error on line 186 is in index.php it is calling the function fCity(obj) on line 395 in index.js

i will look into that but i doubt it is the soure of my problem.

Any help is really apreciated

By the way i tried the original dhtmlwindow.js and the issue remain,

Thanks

Sam

jscheuer1
11-01-2008, 02:20 AM
Made the modification acroding to your direction but
it did not work

If by "it did not work" you mean the modification wasn't made to the live version, you are right. I'm still seeing:


function HideContent(d)
{
if(d.length < 1) { return; }
document.getElementById(d).style.display = "none";
}


Not:


function HideContent(d)
{
if (d.length < 1)
return;
else if (document.getElementById(d))
document.getElementById(d).style.display = 'none';
}

at or about line 185 in your index.js file. And am still getting the error:


Error: document.getElementById(d) is null
Source File: http://www.wakooz.com/scriptstyles/index.js
Line: 185

This is not anything to do with function fCity(obj), as it has no:


document.getElementById(d)

in it.

However, I did say that this (function HideContent(d)) wasn't necessarily the cause. But it is hard for me to diagnose the live page while it still contains this known error. Please update the live installation with the correction I've outlined.

Something else I looked into in the meantime was the demo page for the DHTML Window widget (v1.1) script. It doesn't exhibit the problem (flashing white as it launches a 'window') so this almost certainly has something to do with your implementation. Is there anything unusual about your implementation that you might be aware of? Did you fudge anything or push the script beyond its intended use in any way that you are aware of?

Think about this. It's OK if you did something along these lines. It's just that if you did and can think of what that might be, it would probably help in determining either a solution, or if a different script might be better suited to your needs.

scubajoe
11-01-2008, 05:03 AM
Hi John

I did change the code from

function HideContent(d)
{
if(d.length < 1) { return; }
document.getElementById(d).style.display = "none";
}

TO

function HideContent(d)
{
if (d.length < 1)
return;
else if (document.getElementById(d))
document.getElementById(d).style.display = 'none';
}

On the server and It created problems so i rolled back to what i had

I will fix the javascript error on line 186 and let you know

Thank's for helping

Sam

scubajoe
11-14-2008, 10:57 AM
Hi John

I finally fixed my javascript error unfortunalty it wasn't the problem.

If i remove the 2 following files from http://wakooz.com/index.php

<script type="text/javascript" src="scriptstyles/windowfiles/dhtmlwindow.js"></script>
<script type="text/javascript" src="scriptstyles/modalfiles/modal.js"></script>

The language change stop giving me the with flash.

the file that load the modal windows is:

http://wakooz.com/scriptstyles/index.js

Thank you for you help

Sam

jscheuer1
11-14-2008, 03:48 PM
OK, this is another long shot, but not quite so much as my first idea. The page is reloading when the language changes. The background color for the page is set in style.css to:


body{ background:#8AAB3E; }

But you have so many styles, it takes a little while for that to load. In the body tag itself, you have:


<body bgcolor="#FFFFFF">

Hence, the white flash in IE, or at least it could be what's causing this. So change that to:


<body bgcolor="#8AAB3E">

If that doesn't work out, we may need to use a different script or a different capability of this one (iframe) so as to not have to reload the entire page when the language changes.

scubajoe
11-14-2008, 08:56 PM
Hi John

the background in the page is set to #FFFFFF white but even if i change

to #8AAB3E i get the same flash

I had to set a bgcolor in the body to fix a style issue

but with or whitout the bgcolor i get the same

It must be a function that get's in conflict with the other scripts

Again thanks for your help

Sam

jscheuer1
11-14-2008, 11:17 PM
Once again, you haven't updated the live demo. I cannot proceed in troubleshooting if you do not carry through upon the recommendations with the live test page.

scubajoe
11-15-2008, 06:39 AM
Hi John,

I put bgcolor="#8AAB3E" in the body tag of index.php

Sorry about that i didn't change it because i know it is not the issue

but i got the drill any other idea you have i will change for you in the

live demo

thank you

Sam

jscheuer1
11-15-2008, 01:27 PM
OK, I see you've changed the color to black. On a hunch, using IE developer toolbar, I added this to the page's style:


html {
background: black;
}

Presumably, you could use the more correct:


html {
background-color: #000;
}

but developer toolbar wouldn't hold that on reload, so I cannot be 100% sure if that will be as effective.

Anyways, by setting the background to black for the html tag, that took care of the problem in testing here.

Now, remember what I said before about the styles taking some time to load. That may or may not also be at issue. If it is, you must make this style the very first one of your very first stylesheet. To be on the safe side, put it right on the page:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="description" content="Wakooz is your customizable portal that will provide you with simple bookmarking and quick access to your favorite websites from any computer in the world." />
<meta name="keywords" content="Canada,Montreal,New York,USA,United States,Accommodations,Art and Culture" />
<title>Wakooz</title>
<style type="text/css">
html {
background: black;
}
</style>
<script>var language = 'EN';</script>
<!-- Javacript functions -->
<script type="text/javascrip

scubajoe
11-19-2008, 05:53 PM
Hi John

I put just below the head in index.php

<style type="text/css">
html {
background: #7FBBED;
}
</style>
* cannot leave it in the live demo because it over writes styles choosen by the users.

and body tag is set <body bgcolor="#7FBBED">

#7FBBED is the same background color that i have in the default style at the moment scriptstyles/styles.css

So yes you are right it fixes the white flash but it seem the background color in not the issue. It just the changes the white flash for a blue one.

So the real issue it that when i remove the 2 scripts

<script type="text/javascript" src="scriptstyles/windowfiles/dhtmlwindow.js"></script>
<script type="text/javascript" src="scriptstyles/modalfiles/modal.js"></script>

and then change language the page does not reload the background nor images just like in firefox.

so no flash...

Again John thank you for you help

Cheers

Sam