Refining the popup?

G

George Hester

I have a page that when the user accesses certain links a chromeless window (2) appears and meshes with the newly formed parent window (1). Works nicely in IE 5+ but in IE 6 it's not so good but OK for now.

Anyway in IE 5;5.5 the chromeless window appears. I have made it so (2) can be moved around on the screen with the mouse and also so that if the parent (1) is minimized leaving (2) only on the desktop when the links in that are clicked, the parent window will focus and that is where the child's (2) link will appear.

I have one last refinement that I'm hoping someone can shed some light on. I have this in the parent:

<script type="text/javascript">
function window_onfocus(){
if (agilePopper){
this.blur();
agilePopper.focus();
}
}
</script>
<!-- -->
<script type="text/javascript">
window.onfocus = window_onfocus;
</script>

The idea here is if the parent window is brought to focus the chromless window agilePopper will stay on top and keep the focus. That's fine but here's my trouble. If there is another window open on the desktop then the parent will fall behind that too. So yes it stays behind agilePopper but also goes behind any other window open on the desktop. I'd prefer it stay right behind agilePopper. Sort of like a z-order (increasing left to right): any open window on desktop - Parent - agilePopper.

If this is not possible using JavaScript that's fine I won't look into it further. But if it is I'd like any suggestions how this might be achieved. Thanks.
 
I

Ivo

The idea here is if the parent window is brought to focus the chromless
window agilePopper will stay on top and keep the focus. That's fine but
here's my trouble. If there is another window open on the desktop then
parent will fall behind that too. So yes it stays behind agilePopper but
also goes behind any other window open on the desktop. I'd prefer it stay
right behind agilePopper. Sort of like a z-order (increasing left to
right): any open window on desktop - Parent - agilePopper.

<script type="text/javascript">
function window_onfocus(){
if (agilePopper){
this.blur();

Remove this line. That answers your question.
agilePopper.focus();
}
}
</script>
<!-- -->
<script type="text/javascript">
window.onfocus = window_onfocus;
</script>

Merge those two script blocks into one. There is no reason to separate them.
 
G

George Hester

--
George Hester
__________________________________
Ivo said:
Remove this line. That answers your question.


Merge those two script blocks into one. There is no reason to separate them.

New function:

function window_onfocus(){
if (agilePopper){
this.blur();
//agilePopper.focus();
}
}

It doesn't work. Click on the parent once the title bar of the Parent becomes active and agilePopper stays on top. Click again agilePopper falls behind the Parent. Can't have that either. Mine does keep agilePopper always on top no matter how many times the Parent is clicked.

The issue is though that the Parent falls behind every open window on the desktop. Not just agilePopper. Thanks.
 
G

George Hester

Ivo said:
Remove the line below:


Remove the above line.

Well not sure what your are referring to. As far as I can tell you suggest the function be this:

if (agilePopper){
//this.blur();
//agilePopper.focus();
}
}

Which will definitely error out and does nothing. I have actually fixed the issue somewhat and have noticed some weird behavior. I'll ask in a differrent thread becasue I think this one has run it's course. I really do not understand your directions. Sorry. Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top