Wrong position of an marker

16/11/2008 - 09:40 von Roland Mösl | Report spam
At the end of a directory, I have the element

<span id=dem></span>

The only reason for this element is,
that javascript can find out where the last element
of the directory is and decide to insert something or not

<div id=directory1>
Here comes entry 1<br>
Here comes entry 2<br>
Here comes entry 3<br>
<span id=dem1></span>
</div>

Here works all fine.

But at an other directory

<div id=directory2>
Here comes entry 1 &nbsp;
Here comes entry 2 &nbsp;
Here comes entry 3 &nbsp;
<span id=dem2></span>
</div>

The position of the end marker in MSIE 7 is 0,0
Firefox shows the correct position

Now I tested little bit changed

<div id=directory2>
Here comes entry 1 &nbsp;
Here comes entry 2 &nbsp;
Here comes entry 3 &nbsp;
<span id=dem2>TEST ENDMARKER</span>
</div>

Now suddenly MSIE 7 shows the correct position of the end maker

<div id=directory2>
Here comes entry 1 &nbsp;
Here comes entry 2 &nbsp;
Here comes entry 3 &nbsp; <BR>
<span id=dem2></span>
</div>

Also here correct position of the end marker

So I found out the following condition for
the error in MSIE 7 to show a wrong end marker position

if there is no prvvious <br> element in the parent
if there is nothing printable in the object

the postion is wrongly reported with

offsetTop=0
offsetLeft=0



Roland Mösl
http://politik.pege.org Steuerreform pro Mensch
http://notebook.pege.org mobile Computing
http://auto.pege.org Auto und Verkehr
http://wohnen.pege.org Bauen und Wohnen
 

Lesen sie die antworten

#1 Kai Schaetzl
16/11/2008 - 12:31 | Warnen spam
Ich denke du weißt sehr genau, daß du sowohl sprachlich wie thematisch
hier falsch bist.

Kai
Infos zum IE: http://iefaq.info & http://ie6.winware.org
Infos zu Windows und OE: http://www.mvps.org & http://oe-faq.de
Infos über Updates: http://patch-info.de

Ähnliche fragen