Page 2 of 2

Posted: Sat Jan 01, 2005 10:26 am
by Shendemiar
feyd wrote:Textboxes, buttons, dialogue boxes, all kinds of stuff are windows in Windows. This may be true in other OS's as well, I'm not sure.

The reason you only get it in IE is likely because of the event model used. Although I can't say for sure, in any real direction.
Thats very intresting knowledge.

So i need an alternate way...

I need to make sure the popup gets focus, and comes to top of other windows, when new content to it is opened. Anybody has a way of doing this?

Posted: Sun Jan 02, 2005 7:39 am
by Shendemiar
I acidently deleted my last post :D

Anyway: I abandoned the onblur->close and made a decent opener function that puts focus to the popup, even if it was allready open.

Posted: Mon Jan 03, 2005 5:37 am
by n00b Saibot
Now i have it down! took a little more time than normal.

Code: Select all

<script>
function closeMe() {MyWindow.close()}
function doIt()
{
MyWindow=window.open('about:blank','SanastoKielet','toolbar=no'); 
MyWindow.focus(); 
MyWindow.document.body.onblur=closeMe; 
return false;
}
</script>
<A HREF="" onClick="return doIt()">Click Here</a>
howzzaat!:D

Posted: Mon Jan 03, 2005 7:57 am
by dreamline
hmmm.. I'll have a look and see if that works for me too.. :D Would be great... Thanks n00b Sailbot.. :D

Posted: Mon Jan 03, 2005 8:12 am
by n00b Saibot
Normally i don't have any probs with JS. this one caused a little prob because of the object model traversal required in it. was a rather crooked one. whatdya say :!: ;-)

Posted: Mon Jan 03, 2005 12:01 pm
by Shendemiar
MyWindow.document.body.onblur=closeMe;

Nice line, works only on IE thou.

But again, i'm a little bit wiser.

Posted: Fri Jan 07, 2005 7:17 am
by dreamline
I've tried a lot of things now and it still doesn't work for me though.. :( I'll have a look to see if there is another way, since i also have probs switching the popup from no scrollbars to with scrollbars and vice versa...

Oh well eventually i'll get the hang of it.. LOL.. hopefully sooner than later.. heheheh

Posted: Fri Jan 07, 2005 5:09 pm
by Shendemiar
dreamline wrote:I've tried a lot of things now and it still doesn't work for me though.. :( I'll have a look to see if there is another way, since i also have probs switching the popup from no scrollbars to with scrollbars and vice versa...

Oh well eventually i'll get the hang of it.. LOL.. hopefully sooner than later.. heheheh
I got it to the part where it worked fine on opera nad firefor, but on IE it closed each time anything was clicked in the window. Not very handy. I abandoned the approach of closing the popups, and got it working.

Anyway, your problem is different. I guess it could be solved with javasript changing the properties of the window, or javascript changing the overflow-properties of a <DIV>. That way you could switch scrolling on and off...

Posted: Wed Jan 12, 2005 11:41 pm
by dreamline
I figured it out and the body onBlur thing works.. :D I also solved my scrollbars problem.. I use 2 different window names so that the scrollbar issue isn't an issue anymore... :D

Thanks guyz for all the input.... :D

Posted: Thu Jan 13, 2005 10:22 pm
by dreamline
Other problem that rises is that i can't use the popup to submit a form anymore.. LOL.. Oh well i'll keep trying.. heheheh

I decided to leave the popups, since for me it's essential that i can close after opening one.. Me as a user would go nuts if i have to close about 4-5 popups after closing my navigator.. So i decided to leave one popup in and the rest is out... Too much trouble for an easy think like that imho.. heheheh...

:D

Posted: Fri Jan 14, 2005 6:47 am
by Chris Corbyn
All you need to do to bring a window into focus is

Code: Select all

windowName.focus

Posted: Fri Jan 14, 2005 6:54 am
by Chris Corbyn
Ignore that last msg.... I'm half asleep at work.... didn't nother to read the ful post LOL :lol:

Posted: Fri Jan 14, 2005 6:59 am
by dreamline
LOL.. I got that sometimes too.. heheheh