Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > NS v. IE hidden

Reply
Thread Tools

NS v. IE hidden

 
 
Lee David
Guest
Posts: n/a
 
      07-21-2005
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


 
Reply With Quote
 
 
 
 
RobG
Guest
Posts: n/a
 
      07-21-2005
Lee David wrote:
> 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.visibil ity = "hidden";


> visitdesc.style.visibility = "Hidden";


document.getElementById('visitdesc').style.visibil ity = "hidden";

>
> if (source == "links")
> {
> linkdesc.style.visibility = "Visible";


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
 
Reply With Quote
 
 
 
 
Lee David
Guest
Posts: n/a
 
      07-21-2005
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


 
Reply With Quote
 
Jedi Fans
Guest
Posts: n/a
 
      07-22-2005
Lee David wrote:
> 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;
 
Reply With Quote
 
J. B. Moreno
Guest
Posts: n/a
 
      07-22-2005
"Lee David" <(E-Mail Removed)> wrote:

> 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>

--
J.B.Moreno
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Populate Hidden field on post back and retrieve value from Hidden Field Rick ASP .Net 3 04-13-2010 05:38 PM
Win 7 folders hidden despite 'show hidden' checked Boppy NZ Computing 10 01-23-2010 02:56 AM
How would I discover the text in a block element hidden by overflow:hidden style being set? SolarCanine Javascript 2 09-20-2005 06:27 PM
Hidden Colour Printer Code Revealed! Silverstrand Front Page News 0 07-28-2005 08:17 PM
activating encryptiong causes device to be hidden from workgroup Keyser Wireless Networking 1 05-10-2005 02:36 PM



Advertisments