View Single Post
Old Feb 8th, 2006, 12:14 PM   #5
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
I posted some example code for this recently.
function enlarge (wURL, sp)
{
	var specs = "width=800,height=600,top=30,left=30," +
	  			"screenx=30,screeny=30," +
			  	"resizable=yes,scrollbars=yes";
	if (sp) specs = sp;
	if (globalWin)
	{
		globalWin.close ();
		globalWin = "";
	}
	popWin = open (wURL, "popWindow", specs);
	popWin.focus ();
	globalWin = popWin;
	return popWin;
}
I don't usually implement it with that global variable, but this is an actual example of a case in which I had an additional goal. This pops a full-sized image into an appropriately sized window when the thumbnail is clicked. Note that the window size (and other features) may be passed in. If they are not, a default set is used.

EDIT: As a matter of fact, you can see this in action by clicking the "Digital Paintings" link in my signature.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote