Click to See Complete Forum and Search --> : Pop up window


tadaw79
10-16-2003, 11:32 AM
Im new to scripting, i have created a web page with 4 different links. I found a page that generates code to make pop up windows, however i want each link to open a different size, i pasted the same script 4 times but all the windows open to the same size, how can i do this orr is there a tutorial on how to use multiple scripts without them affecting each other

requestcode
10-16-2003, 11:39 AM
How about this:
<html>
<head>
<title>Open new window</title>
<script LANGAUAGE="javascript">
function OpenWin(linkid,wid,hit)
{
winprops="width="+wid+",height="+hit+",location=no,status=no,directories=no,toolbar=no,scrollbars=no,menubar=no,resizable=no,top=30,left=3 0"
NewWin=window.open(linkid, "newwin",winprops)
NewWin.focus()
}
</script>
</head>
<body>
<center>
<br><br><br>
<a href="javascript:OpenWin('page4.html','200','200')">Click here</a><br>
</center>
</body>
</html>

You use the same script for multiple links and pass the page to load the width and height when the link is clicked on. The other properties can be set to yes or no depending on what you want the popup to look like. The properties top and left have to do with positioning the popup.

tadaw79
10-16-2003, 12:00 PM
I TRIED THIS SCRIPT, I AM GETTING ERRORS ON LINE 6

requestcode
10-16-2003, 12:04 PM
When I pasted the example some of the lines wraped to the next line. Make sure that any lines that are in the script are all on the same line. The one where you set the variable winprops should all be on the same line. If you could post a link to the page where you tested it or past the code that would help also.