Forum Moderators: open
This is my first post here, so.. please, be gentle, :)
This is the situation, my web site [eyedeasolutions.com...] opens too many windows, i wanted to make the user to see in one fized size and this was the most easyer solution, yet, I've seen some code that allowed to restore the user defaults (befores the visit to my web page) when the window was closed.
I want to change the size and position in the onLoad event and now in a OnClick, and this changes every openning after the user close my window. I've had this working but somehow, I've deleted the code and can't make it anymore..
So If someone can help me..
Thanx
Ozz..
with that code i can change the position and size, but, what I want to do is:
after centering on screen with a certain size, wich I already can make, I want that after the user closes the window, his defaults for size and position are reseted. I don't want to change the defaults of the USER to his browser size and position.
Best Regards,
Ozz...
<script language=javascript>
var usrWidth;
var usrHeight;
var usrLeft;
var usrTop;
function openWin() {
if(usrWidth==null){
window.open('page.html','page','left=300,top=400,width=500,height=500')
}
else
{
window.open('page.html','page','left='+usrLeft+',top='+usrTop+',width='+usrWidth+',height='+usrHeight)
}
}
function changeVars(ship) {
usrWidth=ship.clientWidth;
usrHeight=ship.clientHeight;
usrTop=ship.clientTop;
usrLeft=ship.clientLeft;
}
</script>
and for page.html:
<body onUnload="window.opener.changeVars(window)">
function maximizeWin() {
if (window.screen) {
var aw = screen.availWidth;
var ah = screen.availHeight;
if (aw > 800) window.moveTo((screen.width)? (screen.width-790)/2 : 0, (screen.height)? (screen.height-680)/2 : 0);
else window.moveTo(0, 0);
// window.resizeTo(aw, ah);
window.resizeTo(775, 560);
}
}
<body onLoad="maximizeWin()">
sorry, but i couldn't undestand your code, I'm not using a new window, when I open a window, that's the window I change. the userVars, I already tought about it but could't make it work, try to paste the function maximizeWi() in a blank html file and use the onLoad, then, when you close the window, you'll notice that every window you open after will have that size and position, that's not what i want.
Thanx again
Ozz