PDA

View Full Version : Popup 20+ different links on the same page... possible?


tomstone
12-26-2002, 07:10 AM
Hey... I'm relatively new to the Java scene other than some basic programming at school and such, and I'm trying to struggle along with it... so I've got a question...

I've got a list of names. Let's say they're students in a classroom. What I want to do is have each name linked to its own biography, and I want each of them to popup. Whether it pops up in the same one window or each seperate does not matter. All I want is to have each name have its own command to popup its own biography.

I've tried to do this, and all I can seem to do is have the link popup the same one window for each name, since I can only name one file in the script properties at the top of the page.

I'm sure this is possible to do... can someone show me how?

Thanks...

PauletteB
12-26-2002, 10:15 AM
One way... presuming you want all the windows to have the same parameters.
Windows will be centered with this script.
Change / insert parameters to suit such as:
menubar=yes,toolbar=no,location=yes,status=yes,
scrollbars=yes,resizable=yes,directories=yes

<body>
<script language="JavaScript" type="text/javascript">

function mkWin() {
var w = 500
var h = 400
var X = (screen.availWidth - w) / 2
var Y = (screen.availHeight - h) / 2

var popUp = window.open("","popUp","scrollbars=yes,resizable=yes,width="+w+",height="+h+",left="+X+",top="+Y+"")
}
</script>
<a href="rob.html" target="popUp" onClick="mkWin()">Click for Rob</a><br>
<a href="nol.html" target="popUp" onClick="mkWin()">Click for Nolan</a><br>
<a href="zoo.html" target="popUp" onClick="mkWin()">Click for Zoo</a><br>
</body>

tomstone
12-26-2002, 04:12 PM
Sweet, thanks a lot!