NS v. IE hidden

L

Lee David

I want a description of each button to appear when you mouse over the
button. This is working in IE, but not in NS. Here is the HTML:

<div id="noticedesc"
style="position:absolute; left:180; top:180; visibility:hidden;">
Notices are displayed once and stop when the date has expired.
You can add, delete, change or list notices.<br><br>
Use HTML codes to jazz up your message. Contact the webmaster
for various ideas on this. Always check with Jim, Toby or
Dave when adding a notice.
</div>

Which is repeated for the three buttons and the two "stock" things on the
page. The code to do the switching is:

function staffmouseover(source, img)
{
// alert("**testing** staffmouseover from: " + source + " using: " + img);
staffdesc.style.visibility = "Hidden";
visitdesc.style.visibility = "Hidden";

if (source == "links")
{
linkdesc.style.visibility = "Visible";
}
if (source == "users")
{
userdesc.style.visibility = "Visible";
}
if (source == "notice")
{
noticedesc.style.visibility = "Visible";
}
document[source].src = img;
}

all called from a "mouse over" event. On "mouse out" I turn off the various
help messages and turn on the two stock messages. Only one of the stock
messages appears at all under NS. None of the other text appears. The
mouse over the buttons still causes the image to change with this:

<a href="SQL_Link.php?act=List">
<img src="../buttons/Links.gif" name="links"
onMouseOver="staffmouseover('links', '../buttons/Links_f2.gif')"
onMouseDown="staffmousedown('links', '../buttons/Links_f3.gif')"
onMouseOut="staffmouseout('links', '../buttons/Links.gif')"
alt="Add Links" title="Add Links" border="0"></a>

I thought "<div>" was universal now. Any ideas?

Dave
 
R

RobG

Lee said:
I want a description of each button to appear when you mouse over the
button. This is working in IE, but not in NS. Here is the HTML:

<div id="noticedesc" [...]
</div>

Which is repeated for the three buttons and the two "stock" things on the
page. The code to do the switching is:

function staffmouseover(source, img)
{
// alert("**testing** staffmouseover from: " + source + " using: " + img);
staffdesc.style.visibility = "Hidden";

Here you are using the element id as a global variable - that is an IE
invented, non-standard practice. You should also test that the style
object is supported before trying to use it.

Try something like:

function staffmouseover(source, img)
{
if ( document.getElementById && document.body.style ) {
document.getElementById('staffdesc').style.visibility = "hidden";

visitdesc.style.visibility = "Hidden";

document.getElementById('visitdesc').style.visibility = "hidden";
if (source == "links")
{
linkdesc.style.visibility = "Visible";

document.getElementById('linkdesc').style.visibility = "visible";

etc.

[...]

Read the group FAQ for how to add support for older browsers with
document.all:

<URL:http://www.jibbering.com/faq/#FAQ4_15>
 
L

Lee David

I just couldn't make head nor hair of that. Do you have a simpler site?

I did try to add to the code and now I get a Page Error. How do I find out
what that error was?

TIA, Lee
 
J

Jedi Fans

Lee said:
I want a description of each button to appear when you mouse over the
button. This is working in IE, but not in NS. Here is the HTML:

<div id="noticedesc"
style="position:absolute; left:180; top:180; visibility:hidden;">
Notices are displayed once and stop when the date has expired.
You can add, delete, change or list notices.<br><br>
Use HTML codes to jazz up your message. Contact the webmaster
for various ideas on this. Always check with Jim, Toby or
Dave when adding a notice.
</div>

Which is repeated for the three buttons and the two "stock" things on the
page. The code to do the switching is:

function staffmouseover(source, img)
{
// alert("**testing** staffmouseover from: " + source + " using: " + img);
staffdesc.style.visibility = "Hidden";
visitdesc.style.visibility = "Hidden";

if (source == "links")
{
linkdesc.style.visibility = "Visible";
}
if (source == "users")
{
userdesc.style.visibility = "Visible";
}
if (source == "notice")
{
noticedesc.style.visibility = "Visible";
}
document[source].src = img;
}

all called from a "mouse over" event. On "mouse out" I turn off the various
help messages and turn on the two stock messages. Only one of the stock
messages appears at all under NS. None of the other text appears. The
mouse over the buttons still causes the image to change with this:

<a href="SQL_Link.php?act=List">
<img src="../buttons/Links.gif" name="links"
onMouseOver="staffmouseover('links', '../buttons/Links_f2.gif')"
onMouseDown="staffmousedown('links', '../buttons/Links_f3.gif')"
onMouseOut="staffmouseout('links', '../buttons/Links.gif')"
alt="Add Links" title="Add Links" border="0"></a>

I thought "<div>" was universal now. Any ideas?

Dave
OT but -> left:180; top:180; should be left:180px; top:180px;
 
J

J. B. Moreno

Lee David said:
I want a description of each button to appear when you mouse over the
button. This is working in IE, but not in NS. Here is the HTML:

You should do this entirely in CSS, using hover...it'll work without
javascript, and is more logical to boot.

<style>
..noJS { display: inline;}
..noJS a span {display: none;}
..noJS a:hover {border:none;}
..noJS a:hover span {
display: block;
position: absolute;
}

</style>

<div class="noJS">
<a href="whatever">Home<span>Main page. Welcome to my home.</span></a>
</div>
 

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

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top