SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    May 2000
    Location
    Kentwood, MI, USA
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I was needing to write to a layer from an onmouseover for an image. I have a <div> named and cannot seem to get it to work. Please help.

  2. #2
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    This should do the trick. Post back if you have any problems!

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">code/font><HR><pre>
    &lt;HTML&gt;
    &lt;HEAD&gt;
    &lt;TITLE&gt; Writing to a Layer &lt;/TITLE&gt;
    &lt;SCRIPT LANGUAGE="JavaScript"&gt;
    &lt;!--
    function testfunc() {
    if (document.all) {
    // MSIE 4.x or greater
    document.all.testlayer.innerHTML="BOOM!";
    } else {
    // Netscape 4.x or greater
    document.testlayer.document.open();
    document.testlayer.document.write("BOOM!");
    document.testlayer.document.close();
    }
    }
    //--&gt;
    &lt;/SCRIPT&gt;
    &lt;/HEAD&gt;
    &lt;BODY&gt;

    &lt;DIV ID="testlayer" STYLE="position:absolute;top:100;left:100;"&gt;
    Test layer.
    &lt;/DIV&gt;

    &lt;A HREF="http://your.link.here/" onMouseOver="testfunc();"&gt;Link here!&lt;/A&gt;

    &lt;/BODY&gt;
    &lt;/HTML&gt;
    [/code]

    ------------------
    -Kevin Yank.
    http://www.SitePoint.com/
    Helping Small Business Grow Online!


Bookmarks

Posting Permissions

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