[Javascript] Flash, DHTML, IE6

Flying Lemon Systems nancybv at flyinglemon.com
Tue Jun 18 22:15:59 CDT 2002


Ok, team. I found the problem. It was, of course, a stupid little thing.
Having solved it now, I can tell you that yes, you can include Flash and
DHTML in the same page, and it isn't too difficult either.

Here is the code:

var ns4=document.layers?1:0
var ie4=document.getElementById&&document.all?1:0
var ns6=document.getElementById&&!document.all?1:0

function makeStatic() {
if (ie4) {object1.style.pixelTop=document.body.scrollTop+offsettop}
else if (ns6)
{document.getElementById("object1").style.top=window.pageYOffset+offsettop}
else if (ns4)
{eval(document.object1.top=eval(window.pageYOffset+offsettop));}
setTimeout("makeStatic()",0);
}

I had set my ie4 (assuming ie4, ie5, ie5.5, and ie6 would be covered by it)
to
var ie4=document.all?1:0

Since I hadn't included the document.getElementById part, apparently this
meant that IE6 couldn't handle it properly. I would have expected that one
should then use

object1.style.pixelTop=document.documentElement.scrollTop+offsettop

but it doesn't seem to make any difference.

Now, of course, it may not work properly for IE4, 5, and 5.5, but I'm going
to have to find somebody who can check those out since I don't have them
loaded.

I would upload it but this is not public yet, and so I'm not free to. If it
all gets approved I'd like to show it to you!

N





More information about the Javascript mailing list