Mulitiline Tooltips working in IE, but not in the Gecko based browsers

Discussion in 'ASP .Net' started by tshad, Apr 4, 2005.

  1. tshad

    tshad Guest

    I have a 4 line tooltip that works fine in IE, but not in any of the Gecko
    based browsers.

    Is there a way to make them work there?

    They only show part of the text and replace the new lines with vertical
    black bars (for non printable chars).

    Thanks,

    Tom
     
    tshad, Apr 4, 2005
    #1
    1. Advertising

  2. tshad

    gaidar Guest

    Use cliend-side code to create tooltips (so-called <div> tag based, for
    example).

    ============ CODE ====================
    <script language="JScript">
    var helpPopup = window.createPopup();

    function showHelp(helpID) {
    divHelp = document.getElementById(helpID);

    var helpPopBody = helpPopup.document.body;
    helpPopBody.style.backgroundColor = 'lightyellow';
    helpPopBody.style.border = 'solid black 1px';
    helpPopBody.style.padding = '5px';
    helpPopBody.style.fontFamily = 'Arial';
    helpPopBody.style.fontSize = '12px';
    helpPopBody.innerHTML = divHelp.innerHTML;

    // this hidden popup is used to calculate the height
    helpPopup.show(0, 0, 300, 0);

    var realHeight = helpPopBody.scrollHeight;
    // Hides the dimension detector popup object.
    helpPopup.hide();

    // Shows the actual popup object with correct height.
    helpPopup.show(0, 20, 300, realHeight, event.srcElement);
    }

    function hideHelp(helpID) {
    helpPopup.hide();
    }

    </script>

    ===================== Usage

    <img border="0" src="" align="right" onmouseover="showHelp('helpName')"
    onmouseout="hideHelp()">

    <div id="helpName" style="DISPLAY:none">
    <palign="justify">There is some information.<br>You can use any trag
    here.</p>
    </div>


    Gaidar


    "tshad" <> wrote in message
    news:%...
    >I have a 4 line tooltip that works fine in IE, but not in any of the Gecko
    >based browsers.
    >
    > Is there a way to make them work there?
    >
    > They only show part of the text and replace the new lines with vertical
    > black bars (for non printable chars).
    >
    > Thanks,
    >
    > Tom
    >
     
    gaidar, Apr 4, 2005
    #2
    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. Nicholas Smith

    khtml or gecko for java

    Nicholas Smith, Aug 19, 2003, in forum: Java
    Replies:
    2
    Views:
    921
    Nicholas Smith
    Aug 20, 2003
  2. Samuël van Laere

    Gecko layout engines

    Samuël van Laere, Jul 23, 2003, in forum: HTML
    Replies:
    1
    Views:
    392
    David Dorward
    Jul 23, 2003
  3. Frank
    Replies:
    2
    Views:
    511
    BootNic
    Dec 7, 2006
  4. El Kabong

    Browsers, browsers! Quo vadis?

    El Kabong, May 11, 2007, in forum: HTML
    Replies:
    23
    Views:
    915
    dorayme
    May 13, 2007
  5. RichardOnRails
    Replies:
    0
    Views:
    109
    RichardOnRails
    Jan 27, 2008
Loading...

Share This Page