Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Jun 2002
    Location
    Auckland, New Zealand
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts

    onmouseover effect for netscape and internet explorer not working

    Hi

    The following script is supposed to write text as the mouse is rolled over certain images. The text is written on another part of the screen. I wanted it to work in Netscape and Internet Explorer. Unfortunately the script does not work. The script is at http://homepages.ihug.co.nz/~usatede.../entrytest.htm Can anyone help please?

    <html>
    <head>
    <title>Panacea Art</title>
    <base href="http://homepages.ihug.co.nz/~usateden/panacea/">
    <meta name="GENERATOR" content="Microsoft FrontPage 3.0">
    <style type="text/css">

    .mouseText {
    font: 200 20px "comic sans ms";
    color: sienna;
    }
    .logo {
    font-weight: bold;
    color: crimson;
    }

    </style>
    <script type="text/javascript" language="javascript">

    var MO_text = new Array();
    MO_text[1] = 'Find out who is the <span class="logo">Panacea</span> Artist of the
    Month';
    MO_text[2] ='Come in and see the <span class="logo">Panacea</span> Art Gallery';
    MO_text[3] = 'Find out about the <span class="logo">Panacea</span> Arts Trust';

    function getCell(id) {
    return document.all ? document.all(id) :
    document.getElementById ? document.getElementById(id) :
    document.layers ? document['NS' + id].document.layers[0] : null;
    }

    function setCell(id, content, classname) {
    var c = getCell(id);
    if (!document.layers) {
    c.innerHTML = content;
    if (classname) c.className = classname;
    } else {
    var sSPAN = ((classname) ? '<span class="' + classname + '">' : '<span>');
    c.document.write(sSPAN + content + '</span>');
    c.document.close();
    c.parentLayer.clip.width = c.clip.width;
    c.parentLayer.clip.height = c.clip.height;
    }
    }

    </script>
    <body background="images/bg1.jpg">
    <p align="center"><img src="images/titlelogo.GIF" width="220" height="54"></p>
    <p> </p>
    <div align="center">
    <table border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td width="227" valign="bottom"><a href="artistofmonth.htm" target="_top"
    onmouseover="setCell('textcell',MO_text[1],'mousetext')"
    onmouseout="setCell('textcell','')" ;>
    <img src="first.GIF" border="0" width="227" height="138"></a></td>
    <td width="183" valign="bottom" colspan="2"><a href="#" target="_top"
    onmouseover="setCell('textcell',MO_text[2],'mousetext')"
    onmouseout="setCell('textcell','')">
    <img src="second.GIF" width="183" height="138" border="0"></a></td>
    </tr><tr>
    <td width="227" valign="top">
    <a href="frameset/index.html" target="_top"
    onmouseover="setCell('textcell',MO_text[3],'mousetext')"
    onmouseout="setCell('textcell','')">
    <img src="third.GIF" width="227" height="168" border="0"></a></td>
    <td width="180" valign="top"><img src="fourth.GIF" width="180" height="167"></td>
    <td id="textcell" width="410" valign="top"><ilayer
    id="NStextcell"><layer></layer></ilayer>
    </td>
    </tr>
    </table>
    </div>
    </body>
    </html>

    bye
    Allyson

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    TEXAS . . . 'nuf said
    Posts
    468
    Thanks
    0
    Thanked 0 Times in 0 Posts
    See the following line in your script?

    MO_text[1] = 'Find out who is the <span class="logo">Panacea</span> Artist of the Month';

    If you look at your source code, you'll notice that the word "Month" falls on the next line. This is disabling the entire deal. This line of code has to be on one line (only).

    Try that. If it's still inoperable, come back and let us know so that we may assist you further.

    Good luck.
    Gordo
    "In the End, we will remember not the words of our enemies, but the silence of our friends."
    - Martin Luther King Jr. (1929-1968)

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Posts
    1,404
    Thanks
    2
    Thanked 32 Times in 32 Posts
    This belongs as a continuation of this thread:

    http://www.codingforums.com/showthre...?threadid=1458

    It might also be accompanied by a 'thanks for helping', but, not holding my breath. I can't help it if this editor breaks lines (or people copy them incorrectly).

    adios

  • #4
    New Coder
    Join Date
    Jun 2002
    Location
    Auckland, New Zealand
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi

    Thank-you very much for this script. It works really well, and has achieved exactly what I was after. However, I've added another, introductory, message into the MO_text[0] array and I would like to display that message, everytime that the onmouseover messages do not display. I need a never ending loop function which says that if message="" then message=MO_text[O].


    Thank-you for all your help.

    bye
    Allyson

  • #5
    Senior Coder
    Join Date
    Jun 2002
    Posts
    1,404
    Thanks
    2
    Thanked 32 Times in 32 Posts
    <html>
    <head>
    <title>Panacea Art</title>
    <base href="http://homepages.ihug.co.nz/~usateden/panacea/">
    <meta name="GENERATOR" content="Microsoft FrontPage 3.0">
    <style type="text/css">

    .mouseText {
    font: 200 20px "comic sans ms";
    color: sienna;
    }
    .logo {
    font-weight: bold;
    color: crimson;
    }

    </style>
    <script type="text/javascript" language="javascript">

    var MO_text = new Object();
    MO_text['default'] = 'Introductory message (default)';
    MO_text['artist_of_month'] = 'Find out who is the <span class="logo">Panacea</span> Artist of the Month';
    MO_text['see_gallery'] ='Come in and see the <span class="logo">Panacea</span> Art Gallery';
    MO_text['arts_trust'] = 'Find out about the <span class="logo">Panacea</span> Arts Trust';

    function getCell(id) {
    return document.all ? document.all(id) :
    document.getElementById ? document.getElementById(id) :
    document.layers ? document['NS' + id].document.layers[0] : null;
    }

    function setCell(id, content, classname) {
    var c = getCell(id);
    if (!document.layers) {
    c.innerHTML = content;
    if (classname) c.className = classname;
    } else {
    var sSPAN = ((classname) ? '<span class="' + classname + '">' : '<span>');
    c.document.write(sSPAN + content + '</span>');
    c.document.close();
    c.parentLayer.clip.width = c.clip.width;
    c.parentLayer.clip.height = c.clip.height;
    }
    }

    </script>
    <body background="images/bg1.jpg">
    <p align="center"><img src="images/titlelogo.GIF" width="220" height="54"></p>
    <p> </p>
    <div align="center">
    <table border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td width="227" valign="bottom"><a href="artistofmonth.htm" target="_top"
    onmouseover="setCell('textcell',MO_text['artist_of_month'],'mousetext')"
    onmouseout="setCell('textcell',MO_text['default'])" ;>
    <img src="first.GIF" border="0" width="227" height="138"></a></td>
    <td width="183" valign="bottom" colspan="2"><a href="#" target="_top"
    onmouseover="setCell('textcell',MO_text['see_gallery'],'mousetext')"
    onmouseout="setCell('textcell',MO_text['default'])">
    <img src="second.GIF" width="183" height="138" border="0"></a></td>
    </tr><tr>
    <td width="227" valign="top">
    <a href="frameset/index.html" target="_top"
    onmouseover="setCell('textcell',MO_text['arts_trust'],'mousetext')"
    onmouseout="setCell('textcell',MO_text['default'])">
    <img src="third.GIF" width="227" height="168" border="0"></a></td>
    <td width="180" valign="top"><img src="fourth.GIF" width="180" height="167"></td>
    <td id="textcell" width="410" valign="top"><ilayer id="NStextcell"><layer>
    <span class="mouseText">Introductory message (default)</span>
    </layer></ilayer>
    </td>
    </tr>
    </table>
    </div>
    </body>
    </html>

  • #6
    New Coder
    Join Date
    Jun 2002
    Location
    Auckland, New Zealand
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile

    Hi

    Thank-you very much for this fantastic script.


    bye
    Allyson


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •