bigtiger
06-01-2007, 02:38 AM
Hi, all.
newer to CSS and js.
When working with ff and ie6. The latter is very not w3c conformed. As the example below. With the style of the first div tag was marked with width or height property. It is treaded it as a dummy positioned element. So the offsetParent was pointed to closest positioned node instead of html or body.
Any easy way for this ?
<div style="position:static;margin-left:100px;width:100px;border: solid 1px #000000" id="top">
<div id="pp1">
<div onclick="alert(this.offsetParent.tagName + ' ' + this.offsetParent.id + ' ' + this.offsetLeft)" style="background-color:lightblue;left:0">item1</div>
<span onclick="alert(this.offsetParent.tagName + ' ' + this.offsetHeight)" style="background-color:lightblue;height:20px">item1</span>
</div>
</div>
Also, any jsdom reference to download. I have got an old reference with the url of my page: http://enekz.frih.net/dev/web/jsdom. But this was longer.
Thanks,
newer to CSS and js.
When working with ff and ie6. The latter is very not w3c conformed. As the example below. With the style of the first div tag was marked with width or height property. It is treaded it as a dummy positioned element. So the offsetParent was pointed to closest positioned node instead of html or body.
Any easy way for this ?
<div style="position:static;margin-left:100px;width:100px;border: solid 1px #000000" id="top">
<div id="pp1">
<div onclick="alert(this.offsetParent.tagName + ' ' + this.offsetParent.id + ' ' + this.offsetLeft)" style="background-color:lightblue;left:0">item1</div>
<span onclick="alert(this.offsetParent.tagName + ' ' + this.offsetHeight)" style="background-color:lightblue;height:20px">item1</span>
</div>
</div>
Also, any jsdom reference to download. I have got an old reference with the url of my page: http://enekz.frih.net/dev/web/jsdom. But this was longer.
Thanks,