facebook

getting element offsets

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #325896 Reply

    SonamGyato
    Member

    i’ve got an html element on a page.

    how do i find out what the offset of that element is within the
    page (.offsetLeft .offsetTop don’t work).

    also, how do i find what the current screen dimensions are
    iphone/ipad and also portrait, landscape – just want to know
    what the current “width” and heights are.

    Can I hardcode things like expecting the panel begins at y=43 on
    the iphone…what happens on the ipad or a higher rez screen down the road.

    #325946

    Kale
    Member

    I tried the following code with a panel and it worked.

    var pos= $(‘#m1-index-panel1’).offset();
    alert(‘Position Left: ‘ + pos.left + ‘ Position Top: ‘ + pos.top);

    Greetings Kale

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: getting element offsets

You must be logged in to post in the forum log in