daviiie
08-11-2006, 12:02 PM
function NewBrowser(url, thename, h, w, l) {
var newwindow;
string = 'height=' + h + ',width= ' + w + ',top=0, left=' + l + ',resizable=no'
newwindow = window.open(url, thename, string);
if (window.focus){
newwindow.focus()
}
setInterval("snap2()",500);
}
var newwindow;
function snap()
{
try{
xLoc = window.screenX
yLoc = window.screenY
if (xLoc != 257 & yLoc != 0)
{
window.moveTo(257,0);
}
}catch(err){}
}
I have a browser, that when you click on the appropriate area it will open a new window. But I want that new browser to remain in the place where it opens. As such I have created a snap function, that when you move the window it will immediately snap it back into place.
The problem I am having is that it is snapping the window that is opening the new browser and not the new browser itself. How do I reference the new browser window, can it be done by its name?
Any help would be appreciated.
var newwindow;
string = 'height=' + h + ',width= ' + w + ',top=0, left=' + l + ',resizable=no'
newwindow = window.open(url, thename, string);
if (window.focus){
newwindow.focus()
}
setInterval("snap2()",500);
}
var newwindow;
function snap()
{
try{
xLoc = window.screenX
yLoc = window.screenY
if (xLoc != 257 & yLoc != 0)
{
window.moveTo(257,0);
}
}catch(err){}
}
I have a browser, that when you click on the appropriate area it will open a new window. But I want that new browser to remain in the place where it opens. As such I have created a snap function, that when you move the window it will immediately snap it back into place.
The problem I am having is that it is snapping the window that is opening the new browser and not the new browser itself. How do I reference the new browser window, can it be done by its name?
Any help would be appreciated.