Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. get left/top of a Frame

get left/top of a Frame

Scheduled Pinned Locked Moved Web Development
javascript
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vtalau
    wrote on last edited by
    #1

    hi all, I have a trouble with JavaScript, I want to get location (left, top) of a Frame (a page has three frames). I have tried with getting Document of the Frame var body = DocFrame.getElementByTagname('body')[0] var left = body.offsetLeft however, it always return 0. I'm very happy if you can point me to the answer thanks, lvthanh

    S 1 Reply Last reply
    0
    • V vtalau

      hi all, I have a trouble with JavaScript, I want to get location (left, top) of a Frame (a page has three frames). I have tried with getting Document of the Frame var body = DocFrame.getElementByTagname('body')[0] var left = body.offsetLeft however, it always return 0. I'm very happy if you can point me to the answer thanks, lvthanh

      S Offline
      S Offline
      Shog9 0
      wrote on last edited by
      #2

      You'll want the actual frame element in the document containing the frameset (i suspect you already have this, but can't tell from your example if that's how you're retrieving the frame's document). Once you have this, the offsetTop and offsetLeft properties should give you what you need.

      Citizen 20.1.01

      'The question is,' said Humpty Dumpty, 'which is to be master - that's all.'

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups