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

T

tshad

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
 
G

gaidar

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top