Floating Panel/Div's and Doctype

C

CMM

Has any one gotten a "stay-in-view" floating div to work in ASP.NET 2.0?
For those that don't know, the classic way is this (for IE anyway):
(window.onscroll...)
document.all.Toolbar.style.pixelTop = document.body.scrollTop;
But, this doesn't seem to work in any way with ASP.NET 2.0. The problem
seems to lay in ASP.NET 2.0's default doctype...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

I'd like to keep using this doctype because it helps with rendering tables
consistently across browsers.... anyone know of a way to get
"onscroll...pixelTop = document.body.scrollTop" to work?
 
C

CMM

Found the answer to my own question (after many hours).
Instead of using document.body.scrollTop...
W3C standards call for document.documentElement.scrollTop
I wonder how IE 5.5 reacts to this?
 
F

Flinky Wisty Pomm

use

var doc = document.documentElement ? document.documentElement :
document.body;
....Toolbar.style.pixelTop = doc.scrollTop

if you're worried about backward compatibility.

document.all is likewise deprecated, so use the equivalent
var Toolbar = document.getElementById?
document.getElementById("toolbarId") :
document.all.Toolbar;
 
C

CMM

Frames are a hassle. The toolbar needs easy access to and interact with the
elements on the page. I experimenting with all sorts of combinations using
scrollable div regions but could never get the placement quite right so that
TopPanel took up the top n-pixels and BodyPanel took up the entire rest of
the page without spilling past the viewable region and triggering the
browser's own scrollbars. I know this is a classic problem and there are all
sorts of JavaScripts to adjust div positions on window.onresize and
window.scroll. It's a big mess.

I've seen the Coalesys PanelSet control....but I'm not paying hundreds of
dollars for something that I feel should be easily accomplished in ASP.NET
proper (well, the sizable-splitter in PanelSet is cool... maybe that's worth
it.... but I don't need a splitter, I just need dockable-esque panels).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top