Ask a questionAsk a question
 

Proposed AnswerHTML Object shows null only in Firefox

  • Thursday, November 05, 2009 1:11 PMAshok K Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Hi,
    I'm using javascript calender control in my website.
    when i open my site and launch the JS calender its shows fine. but in Firefox its not displaying correctly.
    in my script i'm finding top and left possition of the control where we need to display the calender as follows.

    do {
    scwEle=scwEle.offsetParent;
    offsetTop +=parseInt(scwEle.offsetTop, 10);
    offsetLeft+=parseInt(scwEle.offsetLeft,10);}
    while (scwEle.tagName != 'BODY' && scwEle.tagName != 'HTML');

    when i run this script from IE its displaying correct top and left posstion of the object. But in Firefox, the object "scwEle.offsetParent" returns as null.

    Can any one suggest me why this is happening only in firefox.

    Thanks in advance

    Regards,
    Ashok

All Replies