Results 1 to 3 of 3

Thread: Hey i has to hang if you dont help me

  1. #1

    Thread Starter
    Big D Danial's Avatar
    Join Date
    Jul 2000
    Location
    ASP.Net Forum
    Posts
    2,877
    Hi Aniz,
    Here is a simple example of how u can hide/show layers in NS,

    This wrote the code in a hurry , so it might contain errors, i will post a better version of the code when i get home from work in few hours.

    Hope this helps

    Code:
    <html>
    <head>
    <script>
    function testit()
    {
    var vis;
    vis=document.layers["test"].visibility;
    
    
    if (vis=="hide")
    	{
    	document.layers["test"].visibility="visible";
    	document.form1.btn1.value="Hide";
    	}
    else
    	{
    	document.layers["test"].visibility="hidden";
    	document.form1.btn1.value="Show";
    	}
    }
    </script>
    </head>
    <body>
    <layer name="test" >
    <h1>Test</h1>
    </layer>
    <br><br><br>
    <form name=form1>
    <input type =button value="Hide" onclick="javascript:testit()" name=btn1>
    
    </form>
    </body>
    </html>
    [VBF RSS Feed]

    There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.

    If I have been helpful, Please Rate my Post. Thanks.

    This post was powered by :

  2. #2

    Thread Starter
    Big D Danial's Avatar
    Join Date
    Jul 2000
    Location
    ASP.Net Forum
    Posts
    2,877
    Hi Aniz,
    Here is a simple example of layer which works in IE and Netscape.

    Hope this helps

    Code:
    <HTML>
    <HEAD>
    <META NAME="GENERATOR" Content="Microsoft FrontPage 4.0">
    <TITLE></TITLE>
    
    <script>
    var ie4,ns4;
    
    ie4 = ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4 ))
    ns4 = ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 4 ))
    
    
    function showlayer(layername)
    {
    
    	if (ie4)
    	{
    	eval("document.all."+layername+".style.visibility='visible'");
    	}
    	else
    	{
    	document.layers[layername].visibility="visible";
    	}
    }
    
    function hidelayer(layername)
    {
    	if (ie4)
    	{
    	eval("document.all."+layername+".style.visibility='hidden'");
    	}
    	else
    	{
    	document.layers[layername].visibility="hidden";
    	}
    }	
    
    
    
    
    </script>
    
    
    </HEAD>
    <BODY bgcolor="#66CCCC">
    <div id="info" style="position:absolute; left:283px; top:102px; width:368px; height:79px; z-index:1; background-color: #999999; layer-background-color: #999999; border: 1px none #000000; visibility: hidden"><b>This 
      is a simple example of Layer which both works in IE and Netscape. This example 
      uses the DIV tag to define the layers.</b></div>
    <div id="Layer2" style="position:absolute; left:283px; top:188px; width:368px; height:46px; z-index:2"> 
      <div align="center">
        <h3><a href="#" onmouseOver="javascript:showlayer('info')" onmouseout="javascript:hidelayer('info')" >Show Info </a></h3>
      </div>
    </div>
    <p align="center">&nbsp; 
    </BODY>
    </HTML>
    [VBF RSS Feed]

    There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.

    If I have been helpful, Please Rate my Post. Thanks.

    This post was powered by :

  3. #3
    Hyperactive Member Kagey's Avatar
    Join Date
    Sep 2000
    Location
    The Wilderness of New Brunswick
    Posts
    294
    Now the poor fellow can live until his next assignment

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