tags:

views:

33

answers:

1

Hi,

when i call the getAbsoluteLeft/Top method i always get 0 in firefox. For the IE i get a value which seems to be correct. Are there known problems using these methods ? My problem is that i want to set the position of an element with the absolute position values of another element. Thanks in advance. Edit: Using GWT 2.0.3

kuku

EDIT Testcase: 1. The host page:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Web Application Starter Project</title>
  <script type="text/javascript" language="javascript" src="samplegwt/samplegwt.nocache.js"></script>
  <script type="text/javascript" language="javascript">
   function execute() {
    var element = document.getElementById("paragraph");    
    if (element != undefined)
        element.style.display = "block";
   }
</script>
<STYLE TYPE="text/css">
#paragraph {
    display: none;
}
</STYLE> 
</head>
 <body class="body" onload="execute()">
   <div align="center">
    <table>
     <tr>
      <td>
       <p id="paragraph">
       <input type="text" id="example" value="Foobar" >&nbsp;<a href="#"><img border="0" src="images/some.gif"  alt="Test"></a></p>
      </td>
      </tr>
     </table>
</div>
  </body>
 </html>

In the onModuleLoad() i simply do this: System.out.println(Document.get().getElementById("paragraph") .getAbsoluteLeft());

A: 

Well as stated in the comments the problem was that the element is not visible which results into 2 different behavoirs for IE and FF.

kukudas