Горизонтальное выпадающее меню со слоями

Обсуждение вопросов клиентского программирования.

Модератор: Duncon

Аватара пользователя
AiK
Сообщения: 2287
Зарегистрирован: 13 фев 2004, 18:14
Откуда: СПб
Контактная информация:

maha, кстати, для таблиц отступы считаются не для BODY, а для TR. Так что нули запросто могут быть.
This example shows how to determine the position of a td object. Although the td object appears to the far right in the document, its position is close to the x-axis and y-axis, because its offset parent is a table object rather than the document body. For Internet Explorer 4.0, this same example returns a position of 0,0 because the offset parent is the table row:

Код: Выделить всё

<HTML>
<HEAD>
  <TITLE>Elements: Positions</TITLE>
  <SCRIPT LANGUAGE="JScript">

  function showPosition()
  {
    var oElement = document.all.oCell;
    
    alert("The TD element is at (" + oElement.offsetLeft + 
          "," + oElement.offsetTop + ")\n" + "The offset parent is " 
          + oElement.offsetParent.tagName );
  }
  </SCRIPT>
</HEAD>
<BODY onload="showPosition()">


This document contains a right-aligned table.
<TABLE BORDER=1 ALIGN=right>
  <TR>
    <TD ID=oCell>This is a small table.</TD>
  </TR>
</TABLE>
</BODY>
</HTML>
О размерах: Measuring Element Dimension and Location
Даже самый дурацкий замысел можно воплотить мастерски
Ответить