Previous Message
Next Message

RE: [css-d] Can I "pop up" a div?

Sent by Nik Schramm on 31 January 2002 12:12


Stephanie,

You'll have to use js and the dom to extract the contents of your layer
and to write them to the new popup window. Beware: Your cross-browser
results may vary with the DOM...

For ie5+ Opera and NN6 something like this should work:

function showWindow(theLayerID) {
	var text = document.getElementById(theLayerID).innerHTML;
	var header = "<html><title>Gimme A Name</title><body>" + text +
"</body></html>";
	var newWin = window.open(header,'','width=400,height=400');
	newWin.document.write(header);
	newWin.focus();
}

Call this function by putting a link such as <a href="#"
onclick="showWindow(insertTheIdOfTheLayer); return
false;">Clickclick</a> somewhere in your document.

For other browsers you have to use different DOM methods, such as
document.layers(id) in NN4 or document.all(id) for IE4, but this should
get you started.

N i k   S c h r a m m
nae | interactive | graphic | arts
iNet: www.nae.de | eMail: [EMAIL-REMOVED]
Previous Message
Next Message

Message thread: