By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,384 Members | 1,847 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,384 IT Pros & Developers. It's quick & easy.

find position of iframe in Mac Explorer 5.x

P: n/a
I'm using offset values to find the x,y position of an iframe on an
html page. The code works in all browsers except in Mac explorer 5.x.
Does anybody have any ideas how to get around this?? Thanks. My code
is below, assuming myFrame is the iframe in question, offsetLeft is the
x coordinate, offsetTop is the y coordinate. For some reason,
offsetParent for the iframe on Mac Explorer is always undefined. Even
stranger, this is only the case for iframe elements. When dealing with
other elements in Mac Explorer 5.x, the code below works fine. Just
the darned iframes are giving me a problem. Any thoughts are
appreciated! - chh
function getMyFramePosition(){
var obj = myFrame;
var offsetLeft = 0;
var offsetTop = 0;
while (obj){
offsetLeft += offsetTrail.offsetLeft;
offsetTop += offsetTrail.offsetTop;
obj = obj.offsetParent;

Oct 16 '05 #1
Share this Question
Share on Google+
1 Reply

P: n/a
The easiest way would be to wrap the iframe in a div, then get the
properties of said div.

But on the other hand, I would be surprised if your referer logs showed
anyone using Mac/IE5 within the past couple of years, so you may just
want to ignore them anyway... just make sure that your site content is
accessible without JavaScript (it is, right?). Someone using a browser
that far behind the times will be used to a sub-par experience anyways.

Oct 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.