Departments
 Info
   Home Page
   Articles
   Software Goodies

 Explanations
   How do they do that?
   The Web in Focus

 Resources
   Web Site Stuff
   Tech Books
   E-Books
   Tech Toys
   Web Hosting
   Links

 Women
   Opinion
   Tech Women
   Women's Studies

 Tech News
   Computer Security
   Databases
   Java
   Linux
   MP3
   PC Software
   Robotics
   Site Owner
   Tech Latest
   Web Development
   XML

 Spread the Word
   Newsletter
   Recommend this Page

 Site Info
   Legal Disclaimer
   Privacy
   Contact

 Lighter Side
   Crazy for Life
   crazy for romance
   Crazy for Kitties
   Crazy for Dogs
   Crazy for Cows

Copyright 2000-2001, hertechnology.com

 
The Web in Focus
Popup Text

The Code

The last thing to do is consider the whole code (with the div_str text shortened just to make the example smaller). Note that the div_str uses single quotes to delimit it. Therefore, any single quote's in the string, like for the word don't, have to be escaped with \.

<script language="JavaScript">
<!--
var IE = (document.all) ? 1 : 0;
var NN = (document.layers) ? 1 : 0;
var div_seen = false;
function div_over(which, on) {

  var div_str = '<table border=1 bordercolor=#99cccc cellpadding=5 bgcolor=#CCFFFF>'+
    '<tr><td>Her Technology is dedicated to bringing you information on a'+
    ' wide range of web-related topics without a lot of geek-speak. '+
    '<a href="javascript:void(\'Just Click\')" onclick="div_over(1,0)">Close</a>.'+
    '</td></tr></table>';

  if (IE) {
    whichEl = eval("document.all.div" + which + ".style");
  } else {
    whichEl = eval("document.div" + which);
  }
  if (on) {
    if (!div_seen) {
      whichEl.visibility='visible';
      if (NN) {
        with (document.div1.document) {
          open();
          write(div_str);
          close();
        }
      } else {
        div1.innerHTML = div_str;
      }
      div_seen = true;
    }
  } else {
    whichEl.visibility='hidden';
  }
}
//-->
</script>

And the DIV statement at the end of the page:

<DIV id='div1' style='position:absolute; visibility:hidden; top:25px; left:150px; z-index:2; width:400; height:180; float:left;' onClick="div_over(1,0)">
</div>
</body>

Instructions for using this code on your page.

Tech Books

Tech Toys

More News

  Want to bookmark this site? Press Control-D. (Hold down the control key and the letter D at the same time.)