SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: hide a layer

  1. #1
    SitePoint Zealot bensheard's Avatar
    Join Date
    Jun 2006
    Location
    Cape Town | South Africa
    Posts
    117
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    hide a layer

    Hi
    This is probably quite simple if possible, but im quite new so if someone could tell me how you can hide an Internet Explorer layer?
    Thanks
    Ben Sheard
    -------------
    Log all your dives easily and quickly from anywhere in the world
    www.divinglogs.cafe150.com

  2. #2
    SitePoint Wizard Pepejeria's Avatar
    Join Date
    Jan 2005
    Location
    Too far up north
    Posts
    1,566
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There is nothing called "internet explorer layer". There are HTML element you can hide though, that you by changing its visibility property

  3. #3
    SitePoint Zealot bensheard's Avatar
    Join Date
    Jun 2006
    Location
    Cape Town | South Africa
    Posts
    117
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK, thanks. But can you help me here...
    Code:
    <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" height="17">
      <tr>
        <td width="20%" onmouseover="show1()" height="17">Heading 1</td>
        <td width="20%" height="17">Heading 2</td>
        <td width="20%" height="17">Heading 3</td>
        <td width="20%" height="17">Heading 4</td>
        <td width="20%" height="17"></td>
      </tr>
    </table>
    <script type = "text/javascript">
     <!--
     function show1(){
      document.write("<div id = 'layer1' style = ' position:absolute; top:40; left:20; width:150; height:80; background-color:silver; z-index:10 ' >Option 1Option 2</div>");
     }
    //-->
    </script>
    This half works, except everything else on the page disappears when this layer appears. And after it appears, how can I get it to disappear???
    Thanks
    Ben Sheard
    -------------
    Log all your dives easily and quickly from anywhere in the world
    www.divinglogs.cafe150.com

  4. #4
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,875
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    When you use document.write after the page finishes loading you overwrite the entire page with new content. The first step is to change your code so that it updates the current page instead of creating a whole new one.

    You need to learn about the Document Object Model (DOM) to do this. A couple of methods you might want to read up on are getElementById() and innerHTML.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">


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
  •