Open Window and show/hide Text

[Total: 0    Average: 0/5]

This example will open up a new window when the user clicks anywhere on the page that is not a link. It will also hide and show text string that is on the screen.

Head Code:

var isIE=document.all?true:false;
var isNS4=document.layers?true:false;
var isNS6=!isIE&&document.getElementById?true:false;
function openIt() {
  var _page = "";
  var _name = "Messages";
  var _parms = "status=yes,top=100,left=200,width=250,height=1";,_name,_parms)

Body Code:

<div id="StartMenu">
This is the stuff inside the start-menu

<script name="startmenu"> 
onclick="openIt()"; // this statement should go inside the body tag to work best!
var h = "hidden"; 
var v = "visible"; 

function showMenu(_v)
  if(isIE) = _v?v:h;
    alert("This script will not run for NS4 because this DIV is positioned relatively and not absolutely!");
	 * This code would run if the DIV was positioned absolutely.
     * document.StartMenu.hidden=_v?"true":"false";
<a href="javascript:showMenu(true)">Show stuff</a><BR>
<a href="javascript:showMenu(false)">Hide stuff</a>

Times Viewed: 2

Leave a Reply

Your email address will not be published. Required fields are marked *