[prog] Popup in PHP or Javascript

Kathryn Hogg kjh at flyballdogs.com
Sat Apr 8 22:52:49 EST 2006

I have a php script that lets us send emails to people who have played in
various leagues.  Since it displays all the email addresses it sends to, I
wanted the "Complete" message to display on the browser without requiring
the someone to scroll down.

 echo "<div class=\"popup\"><h2>Complete!!!</h2></div>\n";

I control the position of the div by using CSS:

div.popup {
    position: fixed;
    top: 10;
    right: 10;
    z-index: 1;
    width: 195px;
    border-width: 1px;
    border-style: solid;
    border-color: #000000;

This makes it render itself in the upper right corner of the browser (with
a 10px padding from the top and right).  The position is fixed which means
it stays there even when I scroll.  The z-index makes it appear in front
of everything with a z-index of 0 (which is the default).


More information about the Programming mailing list