Div tag problem in Mozilla

Discussion in 'Javascript' started by conckrish@gmail.com, Jul 12, 2006.

  1. Guest

    Hai All,

    In my ASP.NET application, I have created a popup window using a
    mouseover event for Label.I have placed all popup controls inside a div
    tag.This popup working well in IE,but not working in mozilla.. How to
    solve this div tag problem?? How to show the Popup ib Mozilla?



    My code look like this :
    =================

    <div class="PopUptransparent" id="PopUp">
    <table class="PopUpMainTable" id="PopupTable" cellSpacing="0"
    cellPadding="0" width="238"
    border="0">
    <tr>
    <td class="PopupBoldTxtBlack" id="lblRemaining" style="PADDING-LEFT:
    3px; PADDING-BOTTOM: 7px; PADDING-TOP: 7px; BORDER-BOTTOM: #99ccff 1px
    solid"
    width="40%"></td>
    <td class="PopupBoldTxtRed" id="lblRemainingVal"
    style="PADDING-RIGHT: 5px; PADDING-BOTTOM: 4px; PADDING-TOP: 4px;
    BORDER-BOTTOM: #99ccff 1px solid"
    width="60%"></td>
    </tr>
    ..
    ..
    ..
    ..
    ..
    </table>
    </div>



    function ShowAuctionDetailPopUp(RemainingName)
    {
    var X;
    var Y;

    document.getElementById('lblRemaining').innerText=RemainingName;
    document.getElementById('lblRemainingVal').innerText=RemainingVal;


    var pos = getElementPos(CtrlId);
    X= pos.x;
    Y= window.event.clientY+document.body.scrollTop+8;
    PopUp.style.left = X;
    PopUp.style.top = Y;

    PopUp.style.display='block';
    PopUp.style.position= 'absolute';
    PopUp.style.left = X;
    PopUp.style.top = Y;
    }
    function getElementPos(sElementID)
    {
    if(!document.getElementById) return null;
    var e = document.getElementById(sElementID);
    if(e == null ) return null;
    var p = { x: 0, y: 0};
    while(e)
    {
    p.x += parseInt(e.offsetLeft,10);
    p.y += parseInt(e.offsetTop,10);
    e = e.offsetParent;
    }
    return p;
    }
     
    , Jul 12, 2006
    #1
    1. Advertising

  2. wrote:
    <snip>
    > <div class="PopUptransparent" id="PopUp">

    <snip>
    > Y= window.event.clientY+document.body.scrollTop+8;


    Mozilla/Gecko browsers do not have a global event object, they pass an
    event object as an argument ot the event handler instead).

    > PopUp.style.left = X;

    <snip>

    Treating the ID attribute of an element as the name of a global variable
    that refers to the element is taking advantage of a non-standard
    approach implemented by Microsoft in IE but mostly not in Mozilla/Gecko
    browsers.

    Non-zero style values are required to include a specification of the
    unit being used. Some browser interpret values assigned without units as
    values with pixel units, but this type of error-correction is not
    universally implemented (or in any way required).

    Richard.
     
    Richard Cornford, Jul 12, 2006
    #2
    1. Advertising

  3. RobG Guest

    wrote:
    [...]

    > document.getElementById('lblRemaining').innerText=RemainingName;


    innerText is a proprietary IE property that is not supported by many
    other browsers. The W3C equivalent is textContent. Search for
    cross-browser solutions in the archives.

    <URL:http://groups.google.com.au/group/comp.lang.javascript/search?q=innertext+textContent+robg&start=0&scoring=d&>

    [...]

    --
    Rob
     
    RobG, Jul 12, 2006
    #3
  4. Guest

    Dear Richard,

    Thnx for ur reply.. Can u explain bit elabrotaly ?? How to
    solve this prob?? Plz give some code snips ...


    Richard Cornford skrev:

    > wrote:
    > <snip>
    > > <div class="PopUptransparent" id="PopUp">

    > <snip>
    > > Y= window.event.clientY+document.body.scrollTop+8;

    >
    > Mozilla/Gecko browsers do not have a global event object, they pass an
    > event object as an argument ot the event handler instead).
    >
    > > PopUp.style.left = X;

    > <snip>
    >
    > Treating the ID attribute of an element as the name of a global variable
    > that refers to the element is taking advantage of a non-standard
    > approach implemented by Microsoft in IE but mostly not in Mozilla/Gecko
    > browsers.
    >
    > Non-zero style values are required to include a specification of the
    > unit being used. Some browser interpret values assigned without units as
    > values with pixel units, but this type of error-correction is not
    > universally implemented (or in any way required).
    >
    > Richard.
     
    , Jul 12, 2006
    #4
  5. wrote:
    > Dear Richard,
    >
    > Thnx for ur reply.. Can u explain bit elabrotaly ?? How to
    > solve this prob?? Plz give some code snips ...


    Can you ask that question in the normal semantic and syntactic units of
    a human language (for practical reasons maybe one I would understand)?

    > Richard Cornford skrev:

    <snip- top post>

    And formatted as a normal Usenet post?

    Richard.
     
    Richard Cornford, Jul 12, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. shruds
    Replies:
    1
    Views:
    840
    John C. Bollinger
    Jan 27, 2006
  2. K Viltersten

    <div ... /> and <div ...></div>

    K Viltersten, Mar 30, 2009, in forum: ASP .Net
    Replies:
    4
    Views:
    757
  3. M Wells
    Replies:
    0
    Views:
    141
    M Wells
    Oct 6, 2004
  4. Dwayne Madsen

    Q: Div A inside Div B is larger than Div B

    Dwayne Madsen, Jun 1, 2005, in forum: Javascript
    Replies:
    1
    Views:
    197
    David Dorward
    Jun 1, 2005
  5. visu
    Replies:
    4
    Views:
    302
Loading...

Share This Page