NS v. IE hidden

Discussion in 'Javascript' started by Lee David, Jul 21, 2005.

  1. Lee David

    Lee David Guest

    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
     
    Lee David, Jul 21, 2005
    #1
    1. Advertising

  2. Lee David

    RobG Guest

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


    --
    Rob
     
    RobG, Jul 21, 2005
    #2
    1. Advertising

  3. Lee David

    Lee David Guest

    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
     
    Lee David, Jul 21, 2005
    #3
  4. Lee David

    Jedi Fans Guest

    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;
     
    Jedi Fans, Jul 22, 2005
    #4
  5. Lee David

    J. B. Moreno Guest

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


    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
     
    J. B. Moreno, Jul 22, 2005
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. cemal eroglu

    Why DOS Window can not be minimized/hidden

    cemal eroglu, Dec 25, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    669
    cemal eroglu
    Dec 25, 2003
  2. daniel caplan

    hidden perl

    daniel caplan, Feb 13, 2004, in forum: Perl
    Replies:
    1
    Views:
    548
    J├╝rgen Exner
    Feb 13, 2004
  3. Radek G.
    Replies:
    4
    Views:
    4,145
    Radek G.
    Jun 18, 2004
  4. Rick
    Replies:
    3
    Views:
    8,511
    Alexey Smirnov
    Apr 13, 2010
  5. SolarCanine
    Replies:
    2
    Views:
    326
    SolarCanine
    Sep 20, 2005
Loading...

Share This Page