demexp-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Demexp-dev] Any ideas to manipulate trees on a web page?


From: skaller
Subject: Re: [Demexp-dev] Any ideas to manipulate trees on a web page?
Date: Tue, 10 Jan 2006 19:29:15 +1100

On Tue, 2006-01-10 at 08:47 +0100, David MENTRE wrote:
> Hello John,
> 
> 2006/1/9, skaller <address@hidden>:
> > This technique uses the Domain Object Model, and Javascript
> > to scan all the objects, and assign a MS specific extension
> > attribute to some objects, namely:
> >
> >     if(targetElement.style.display == "none") {
> >       targetElement.style.display = "";
> >       srcElement.checked = true;
> >     } else {
> >       targetElement.style.display = "none";
> >       srcElement.checked = false;
> >     }
> [...]
> > It does NOT work on Firefox as far as I know: the tree
> > is presented but the branches can't be closed.
> 
> Yep, I noticed that. :-(

The reason is it actually detects IE... it can't work
in Mozilla at least because the script is not run
unless the client is IE.

On Mozilla it degrades gracefully to a permanently opened
tree.

> What I'm looking for is a way to have both: slow but working on old
> browsers, fast and reactive for javascript/CSS capable browsers.

Right. I'd be looking at the technique I'm using with a 
display class synonymous with MS 'none' and with CSS
properties that implement that. Invisible is a valid color
I think -- the problem is that the bounding box of the 
display element needs to be zero height. Font size 0 may
help but probably all the borders and spacing stuff needs
to be set to 0 as well -- and inter element vertical
display padding will have to be universally 0.

If you do find a way to do this using CSS so it works
portably I'd be interested. Also, note that the technique
(which I copied from some web tutorial somewhere years
ago) was, at the time, extremely slow (scanning all DOM
objects -- on old PII box IE could take over 60 seconds
for the page I gave the link for.. I had to tell people,
no it isn't broken .. its just slow .. please
don't hit REFRESH often .. :)

Obviously, a more Database oriented approach where
Javascript selectively links certain DOM objects into
the display or not would be better the fiddling the
display attributes .. however it won't degrade on
a browser not running Javascript -- I have JS turned
off by default.

-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net





reply via email to

[Prev in Thread] Current Thread [Next in Thread]