get left/top of a Frame
-
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
-
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
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
andoffsetLeft
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.'