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

Get IFRAME xy coordinate in Mozilla

P: 2
I want iframe xy coordinate using mozilla, when i execute my code into IE, it returning me proper x & y coordinate but in mozilla it returns me zero of X & Y.

Thanks in Advance
Amit Mittal
Jun 11 '07 #1
Share this Question
Share on Google+
3 Replies


dmjpro
100+
P: 2,476
I want iframe xy coordinate using mozilla, when i execute my code into IE, it returning me proper x & y coordinate but in mozilla it returns me zero of X & Y.

Thanks in Advance
Amit Mittal
Welcome to TSDN.

What is ur code run in IE.
Plz show us.

Kind regards,
Dmjpro.
Jun 11 '07 #2

P: 2
There are two functions that returns me Left & Top coordinate of iframe in IE, But not in any ohter Browser...

function findPosCurleft(obj)
{
var curleft=0;
//alert('obj' + obj);
if(obj!=null)
{
if(obj.offsetParent)
{
//alert('obj.offsetParent' + obj.offsetParent);
curleft=obj.offsetLeft;
//alert('curleft' + curleft);
while(obj=obj.offsetParent)
{
curleft+=obj.offsetLeft;
//alert('curleft + ' + curleft);
}
}
}
//alert('return curleft ' + curleft);
return curleft;
}
function findPosCurtop(obj)
{
var curtop=0;
if(obj!=null)
{
if(obj.offsetParent)
{
curtop=obj.offsetTop;
while(obj=obj.offsetParent)
{
curtop+=obj.offsetTop;
}
}
}
//alert('return curtop ' + curtop);
return curtop;
}
Jun 19 '07 #3

acoder
Expert Mod 15k+
P: 16,027
Have you seen this page? I assume you ave looking at your code. Does it work with other elements?
Jun 19 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.