Connecting Tech Pros Worldwide Forums | Help | Site Map

NS v. IE hidden

Lee David
Guest
 
Posts: n/a
#1: Jul 23 '05
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



RobG
Guest
 
Posts: n/a
#2: Jul 23 '05

re: NS v. IE hidden


Lee David wrote:[color=blue]
> 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"[/color]
[...][color=blue]
> </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";[/color]

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.visibil ity = "hidden";

[color=blue]
> visitdesc.style.visibility = "Hidden";[/color]

document.getElementById('visitdesc').style.visibil ity = "hidden";
[color=blue]
>
> if (source == "links")
> {
> linkdesc.style.visibility = "Visible";[/color]

document.getElementById('linkdesc').style.visibili ty = "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>


--
Rob
Lee David
Guest
 
Posts: n/a
#3: Jul 23 '05

re: NS v. IE hidden


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


Jedi Fans
Guest
 
Posts: n/a
#4: Jul 23 '05

re: NS v. IE hidden


Lee David wrote:[color=blue]
> 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
>
>[/color]
OT but -> left:180; top:180; should be left:180px; top:180px;
J. B. Moreno
Guest
 
Posts: n/a
#5: Jul 23 '05

re: NS v. IE hidden


"Lee David" <affordable_turnkey_solutions@comcast.net> wrote:
[color=blue]
> 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:[/color]

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>

--
J.B.Moreno
Closed Thread