[thelist] Why is NS6 DHTML so SLOOOOOOOOOWWWWWWW?!
Edwin Martin
e.j.martin at chello.nl
Tue May 8 08:25:27 CDT 2001
Peter-Paul wrote:
>Please don't forget that at the moment we cannot make commercial sites
>that extensively use the W3C DOM because not enough browsers support it
>(only 80%, which is too little). So we'll have to wait until the Version 4
>browsers are out.
With a little JavaScript, it's not hard to make DHTML which works in
all DHTML-browsers.
E.g. you have this layer:
<style type="text/css">
#mylayer {
position: absolute;
top: 300px;
left: 30px;
background-color: orange;
}
</style>
<div id="mylayer">
Text in a layer.
</div>
Just add this JavaScript function:
<script language="JavaScript">
function getStyle( layer ) {
if( document.getElementById ) {
return document.getElementById( layer ).style
} else if( document.all ) {
return document.all[layer].style
} else {
return document[layer]
}
}
</script>
And in JavaScript, you can change all kinds of properties:
getStyle('mylayer').left = 120
getStyle('mylayer').top = 100
getStyle('mylayer').visibility='hidden'
getStyle('mylayer').visibility='visible'
getStyle('mylayer').zIndex = 2
This works in Netscape Navigator 4 and higher and Internet Explorer 4 and
higher!
With a little JavaScript you can also make cross-browser clipping and
content-changing. (And that's about it for cross-browser possibilities).
And I never noticed Netscape 6 being slower than other browsers.
There is no excuse not supporting the W3C standards!
Bye,
Edwin Martin.
--
Surf Edwin Martin's brainwaves: http://www.bitstorm.org/edwin/
More information about the thelist
mailing list