troubleshooting Question

Safari CSS (or JavaScript) related problem

Avatar of maesk
maesk asked on
JavaScriptCSSWeb Browsers
5 Comments1 Solution591 ViewsLast Modified:
Hi

I have a problem in Safari on Mac OS X 10.4.8 with the display of tooltip-style footnotes. It works in IE, Firefox and Opera but not Safari. I think the problem is CSS related. Normally, onmouseover the footnote is displayed, on mouseout it is hidden again. The footnote div always is displayed directly underneath the exponent (the number within the <sup> tags). However, in Safari, some and only some footnotes are displayed a bit too high, so that the exponent number is covered by the footnote div. In this case, the browser doesn't recognize the onmouseout event anymore and the footnote remains displayed for all time.

This is my HTML Code:

<div class="entry"><b>1:</b>Some Text<sup><a href="#" id="exponent1" class="exponent" onmouseover="javascript:footnoteOn(1)" onmouseout="javascript:footnoteOff(1)">1</a></sup>
<div id="footnote1" class="footnote">Text of the footnote</div>
</div>

This is the CSS:

.footnote {
display:none;
width:500px;
background-color:#FFFFFF;
background-image:url(../img/fn_bg.jpg);
background-repeat:repeat-x;
border:1px solid #999999;
padding:20px;
text-align:left;
}

and these are the JavaScript functions:

function footnoteOn(nr) {
fnName = "footnote" + nr;
document.getElementById(fnName).style.display = "block";      
document.getElementById(fnName).style.position = "absolute";
}

function footnoteOff(nr) {
fnName = "footnote" + nr;
document.getElementById(fnName).style.display="none";      
}

I could make it position:relative instead of absolute, then it works in Safari as well, but this would be my last option as I don't like it when the footnotes get displayed between the text entries instead of over it.
Any ideas on how to fix this?

Thanks,
maesk
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 5 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros