Click to See Complete Forum and Search --> : code needed for custom pop-up window


avm
02-08-2003, 11:58 PM
I would like to have a text link call up a custom pop-up window when clicked. So far, using Dreamweaver, I have only been able to create a pop-up window from a roll-over, and when the link is actually clicked the original browser window is filled with the content that should be in the pop-up. I have been able to choose the size of the window and specify no menu bar, etc. I have done all this in Dreamweaver. Any suggestions?

Nicodemas
02-09-2003, 06:49 AM
Do a search on the web for modeless windows.

www.dynamicdrive.com

Dan Drillich
02-09-2003, 07:30 AM
Please try -


<html><head><title>Open a window</title>
<script language="JavaScript">
<!-- hide me

function openWin() {
var new_window = window.open("http://www.iwon.com","html_name","width=200,height=200");
}

// show me -->
</script>
</head>
<body>

<h1>Open a new window</h1>
<a href="#" onclick="openWin();">Open a window</a><br>



</body>
</html>

Charles
02-09-2003, 08:15 AM
The problem with Mr. Drillich's method is that when the user isn't using JavaScript you will end up with a link that does nothing at all. Please use:

<a href="http://www.w3c.org/" onclick="window.open(this.href, 'child', 'height=300,width=200'); return false">W3C</a>

And see http://developer.netscape.com/docs/manuals/js/client/jsref/window.htm#1202731 for how to further configure the child window.

Dan Drillich
02-09-2003, 08:38 AM
Got it Charles, Thanks!