Closed Thread Icon

Topic awaiting preservation: inner HTML problem (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=8979" title="Pages that link to Topic awaiting preservation: inner HTML problem (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: inner HTML problem <span class="small">(Page 1 of 1)</span>\

 
shawn tate
Obsessive-Compulsive (I) Inmate

From: ireland
Insane since: Jan 2004

posted posted 01-02-2004 18:42

Heya

This window im working on isn?t doing the same for both functions
1) When I open window #1 and close the main screen at the top of the page NOT the small window the small window remains on my desktop yet when I open window #2 and do the same thing everything closes which is what I want to happen

2) Also when I click anywhere on the back page around the small window when either window # is open the small window minimizes to my taskbar even when i resize the main screen


Anyway of making window#1 the same as I want like with window#2
And
Stopping either windows shrinking to my taskbar when the back page is clicked or resized

cheers

sorry about the size of this thing my sites not running yet


<body bgcolor="#ffffff">

<script language="JavaScript">

var winheight=1;
var winwidth=1;
var TW=null;
var speed=4;

function testWindow(name,width,height,title) {
if (!document.layers&&!document.all&&!document.getElementById) {
paramstp="height="+height+",width="+width+",top=0"+",left=0,scrollbars=no"
TW=window.open("","TW",paramstp);
}
LeftPosition=(screen.width)?(screen.width-width)/2:0;
TopPosition=(screen.height)?(screen.height-height)/2:0;

if (document.layers){paramstp="height="+",width="+",top="+TopPosition+",left="+LeftPosition+",scrollbars=no"
} else {
paramstp="height="+winheight+",width="+winwidth+",top="+TopPosition+",left="+LeftPosition+",scrollbars=no"
}
TW=window.open("","TW",paramstp);
if (document.all) {string="<html><title>"+title+"</title><body topmargin=0 leftmargin=0>"+'<IFRAME src=TEST.htm width=250 height=250></IFRAME>'+'</body></html>';
}
if (document.getElementById&&!document.all) {
toppos=height/2-0;
leftpos=width/2-0;
string="<html><title>"+title+"</title><IFRAME src=TEST.htm width=250 height=250></IFRAME>"+"</body></html>";

x=y=speed;
while (x

Yossi Admon
Bipolar (III) Inmate

From: Israel
Insane since: Nov 2001

posted posted 01-04-2004 09:59

You overwrite the window.onfocus twice.
window.onfocus=CloseTWWin;
and than
window.onfocus=CloseTW2Win;
last one is the one metters.

You can use the following code
function _attachToEvent(obj, name, func){
name = name.toLowerCase();
// Add the hookup for the event.
if(typeof(obj.addEventListener) != "undefined"){
if(name.length > 2 && name.indexOf("on") == 0) name = name.substring(2, name.length);
obj.addEventListener(name, func, false);
} else if(typeof(obj.attachEvent) != "undefined"){
obj.attachEvent(name, func);
} else {
if(eval("obj." + name) != null){
// Save whatever defined in the event
var oldOnEvents = eval("obj." + name);
eval("obj." + name) = function(e) {
try{
func(e);
eval(oldOnEvents);
} catch(e){}
};
} else {
eval("obj." + name) = func;
}
}
}

_attachToEvent(window, "onfocus", CloseTWWin);
_attachToEvent(window, "onfocus", CloseTW2Win);


Yossi.

shawn tate
Obsessive-Compulsive (I) Inmate

From: ireland
Insane since: Jan 2004

posted posted 01-04-2004 21:02

Hey Yossi thanks for the reply
I had some luck withthe code you posted but i think i should have made myself more clear on the second part of the requirments

In part 1 of my question
Both small windows #1 and #2 now close when the main page is closed like i wanted so thats good news

but............

instead of the small window staying where it is when the back page is clicked . It now closes also which isnt very practical if someone clicks their mouse on the page by mistake if you recall the window used to minimize to the taskbar and it was this minimizing i wanted to stop
Any chance you can send me some code that does the first part and stops the small window from minimizing or closing if the BACK page is clicked
I only want it to close when close is actually made

Cheers

Hugh
Paranoid (IV) Inmate

From: Dublin, Ireland
Insane since: Jul 2000

posted posted 01-04-2004 21:53

lo Shawn, it's good to see more of us here :P

« BackwardsOnwards »

Show Forum Drop Down Menu