Search code examples
javascripthtmliosipaduiwebview

How to get position of an element in UIWebView?


I have UIWebView loaded with html in my iPad Program. By using -webkit-column-width, I divided the html with several columns.

padding: 0px
height: 1024px
-webkit-column-gap: 0px
-webkit-column-width: 768px

How can i get the element position(x, y) in webview? The position is on the screen position, not in the html. So y is in range from 0 to height of webview.

Thanks in advance.


Solution

  • Ok, i solved using jquery function

    var p  = $("tag");
    var position = p.position();
    

    I gets real x, y values. Thanks.