-
Doctype
I'm trying to use:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
XHTML 1.0 transitional as my DOCTYPE on a page. Everything works fine, except for a 'Floating DIV' I have a DIV that stays at a certain location on the screen even after scrolling. Here's the function:
Code:
function doIt() {
document.getElementById('sd').style.top = document.body.scrollTop + 50
}
and in the body tag I have onScroll="doIt()"
Now, this script works if I remove the DOCTYPE bit, but I want to keep it, or at least have a DOCTYPE. Does anyone know of any DOCTYPE that supports this, or do you know how to get around this?
-
Does the div have an id attribute or only a name attribute? It needs an id attribute.
However that might not be it.
-
it is a id
I think it is the scrollTop bit. I don't think that actually exists in any proper versions of HTML.
-
It's a possibility. Not that it doesn't exist, but IE has differences in scripting when in standards (*cough*) mode. It might have a different value.