CRASH_OVERRIDE
01-06-2003, 04:13 PM
I've tried this script only on my current computer (IE6,Moz1.2,Win2000server), and it worked fine all the time. Now when I tried it on another computer (IE6,WinXPhome), I get a 'Runtime Error:The object invoked has disconnected from its clients' when I click on the initiate "openMode('popup')" and "openMode('fullscreen')". Any ideas?
//WINDOW OPENER
//---------------------------------
var win=null;
var resize,sizex=100,sizey=100;
function openMode(mode){
if(mode!=''){
switch(mode){
case 'normal':
window.location='index.htm';
break;
case 'fullscreen':
window.open('index.htm','','fullscreen=yes');
break;
case 'popup':
win=window.open('index.htm','','width=100,height=100,scrollbars=yes,adress=no,status=no,location=no, resizable=no,directories=no,menu=no,top=150,left=150');
resize=window.setInterval('resizex()',1);
break;
}
}
}
function resizex(){
win.resizeBy(10,0);
sizex++;
if(sizex==160){
window.clearInterval(resize);
sizex=100;
resize=window.setInterval('resizey()',1);
}
}
function resizey(){
win.resizeBy(0,3);
sizey++;
if(sizey==160){
window.clearInterval(resize)
sizey=100;
}
}
<button class="left" onmouseover="this.className='hover'" onmouseout="this.className=''" onClick="openMode('normal')">NORMAL</button>
<button class="mid" onmouseover="this.className='hover'" onmouseout="this.className=''" onClick="openMode('popup')">POPUP</button>
<button class="right" onmouseover="this.className='hover'" onmouseout="this.className=''" onClick="openMode('fullscreen')">FULLSCREEN</button>
//WINDOW OPENER
//---------------------------------
var win=null;
var resize,sizex=100,sizey=100;
function openMode(mode){
if(mode!=''){
switch(mode){
case 'normal':
window.location='index.htm';
break;
case 'fullscreen':
window.open('index.htm','','fullscreen=yes');
break;
case 'popup':
win=window.open('index.htm','','width=100,height=100,scrollbars=yes,adress=no,status=no,location=no, resizable=no,directories=no,menu=no,top=150,left=150');
resize=window.setInterval('resizex()',1);
break;
}
}
}
function resizex(){
win.resizeBy(10,0);
sizex++;
if(sizex==160){
window.clearInterval(resize);
sizex=100;
resize=window.setInterval('resizey()',1);
}
}
function resizey(){
win.resizeBy(0,3);
sizey++;
if(sizey==160){
window.clearInterval(resize)
sizey=100;
}
}
<button class="left" onmouseover="this.className='hover'" onmouseout="this.className=''" onClick="openMode('normal')">NORMAL</button>
<button class="mid" onmouseover="this.className='hover'" onmouseout="this.className=''" onClick="openMode('popup')">POPUP</button>
<button class="right" onmouseover="this.className='hover'" onmouseout="this.className=''" onClick="openMode('fullscreen')">FULLSCREEN</button>