[thelist] Explorer like tree?
Marcus Andersson
marcus at bristav.se
Wed May 26 17:35:05 CDT 2004
Simon Perry wrote:
> Surely you can recycle those images, you can even take things one step
> further and use one image with all you icons on it. This approach was
> started of by pixy's Fast rollovers[0]
How does that help to reuse images in IE (which is the primary and perhaps only target browser)? I would
really like to know.
I've done some testing on image reuse with IE6 and I can't preload (well, I can preload but when I try to use
it it goes to the server and reloads anyway) and I can't clone images with DOM because it goes down to the
server to get the image again (checked with web server logs). It's pretty funky actually... not! If someone
can show a way to get around this I would be more than happy. The same goes for when you have
background-images and change class (which might even have the same background-image), down to the server again
and now you probably will have some cool flickering as well (the fast rollovers might help with this but not
in all cases I think). MS seems to think that caching is a *really bad* idea!!!
> and expanded on in an article on
> alistapart CSS Sprites[1]. The javascript to control the menu should
> also be quite straight forward if you use the DOM[2] to transverse your
> nested lists adding the events and behaviors you require. I would create
> a static CSS styled tree first
This won't be used on "normal" web sites but in a "rich client" where there is extensive scripting going on so
it's not really an issue here. The tree, the html of it, will probably be rendered with XSLT on the client
(ideally that is, the current tree is rendered this way, it's not impossible to change my mind though) since I
want to do filtering on the XML data that is visualized, and then I just listen for every mouse event in the
tree from a containing element and decides what to do with the help of the srcElement in the event object (or
target if Moz).
Btw, since you talked about building the tree with DOM, did you know that it's much faster to create a large
tree as a string of HTML and insert it with innerHTML in IE than to use the DOM? I did some tests and the
differences are quite remarkable and I tested to both build and insert small chunks of nodes as you walked
along and to build larger chunks and insert (some "guru" on MSDN claims that it's faster to insert small
chunks of nodes often than to insert large chunks few times). It was a while ago but I think it was a
difference of factor 5 or something like that. Using DOM in IE is slower than in Moz but using innerHTML in IE
is a lot faster. Strange. But everything else is better in Moz (almost anyway, I wish SVG were standard (I use
VML in IE and quite like it) and that the XSLT engine was a little better).
/Marcus
More information about the thelist
mailing list