Click to See Complete Forum and Search --> : how to specify x,y location on var rep=open(newwin)


lcscne
10-08-2003, 03:12 PM
Is there a way to specify the x,y location of a new browser when doing a:

var progrep = open(newwin)

I'm opening a few new windows and they're all stacked not cascaded.

lcscne
10-08-2003, 03:49 PM
This from Dimitri

use moveTo()

Here's a simple demo to give you an idea of how it works (and make sure you have popup killers disabled in your browser):

<html>
<body>
<script>
var totalWindows = 4;

for (var x = 0; x < totalWindows; x++) {
var foo = window.open("","win" + x,"left=" + (x*210) + ",top=0,width=190,height=100");
foo.document.open();
foo.document.write("Sample Window #" + (x+1));
foo.document.close();
}

function cascade() {
for (var x = 0; x < totalWindows; x++) {
var foo = window.open("","win" + x);
foo.moveTo(x*100,x*30);
foo.focus();
}
}
</script>
<br><br><br><br>
<a href="javascript:cascade()">cascade these windows</a>
</body>
</html>