Results 1 to 5 of 5

Thread: layer in netscape??

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 1999
    Posts
    89
    Anybody know how to hide a layer and display a layer in netscape?

    I need to us the <div> tag instead of the <layer> tag.

    I used document.all.layername.visibility="hidden" and it works in IE.

    But when i use document.layers.layername.visibility="hidden", netscape give me no property error.
    Anybody have any idea?

  2. #2
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    try this:


    Code:
    document.object2.visibility = 'hidden';
    and the layer is defined thus:

    Code:
    <div ID="object2" STYLE="position:absolute;top:145;left:270">
    
    </div>
    Mark
    -------------------

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Aug 1999
    Posts
    89
    This doesn't work in Netscape.
    my Structure:

    <body onload="hideLayer()">
    <table>
    <tr><td>
    <div name=test id=test>
    <table>
    </table>
    </div>
    </td>
    </tr>
    </table>
    </body>

    function hideLayer() {
    if (document.layers) {
    document.test.visibility="hidden";
    }
    else if (document.all) {
    document.all["test"].style.visibility="hidden";
    }
    }

    IE is working, netscape is not. Anybody has a solution?

  4. #4
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    it seems that you DIV needs to have some style attibutes defined.

    also, defining DIVs within a table id a bit er... unusual.






    this works:
    Code:
    
    <HTML>
    <HEAD>
    <Script language=javascript>
    function hideLayer() 
    {
    	if(document.layers) 
    	{
    		document.obj1.visibility="hidden";
    	}
    	else if (document.all) 
    	{
    		document.all["obj1"].style.visibility="hidden";
    	}
    } 
    </script>
    </HEAD>
    <body onLoad="hideLayer()">
    
    	<div id='obj1' STYLE="position:absolute;top:145;left:270">
    		
    		some text
    	</div>
    
    </body>
    </HTML>
    Mark
    -------------------

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Aug 1999
    Posts
    89
    You are right.
    My problem is the table.
    If i put the <div> as below:
    <table>
    <tr><td><table>
    <div><tr><td><table><tr><td>testing</td></tr></table></td></tr></div>
    </table></td></tr>
    </table>
    It works in IE but not netscape. If i put it opposite:
    <table>
    <tr><td>
    <div>
    <table>
    <tr><td><table><tr><td>testing</td></tr></table></td></tr>
    </table></div></td></tr>
    </table>
    It totally will not work.

Posting Permissions

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



Click Here to Expand Forum to Full Width