R
Richard Shewmaker
I've only recently returned to (trying to) doing simple JS, so this is
probably a really lame question.
I have a Web page with a series of graphics in it (window A).
Clicking on a graphic in A opens a small pop-up window (window B) over A.
If the visitor clicks on B, it closes.
If the visitor clicks back on A -- the page or a new graphic -- A comes
to the forefront and hides B.
If B remains open (visitor does not click on it) and visitor clicks on
another graphic on A, the contents of B are replaced by whatever the new
link points to (or the same if the same graphic is clicked on).
I can make all the above happen. What I can't figure out is how to set
the focus back on B, so that it comes to the forefront, after clicking
on a graphic in A. I've messed around with focus() in all sorts of ways
but can't get B to come back to the foreground. My attempts include
adding a focus statement in the page loading (graphic.html in the
example below).
This is what works:
function secWin(url) {
window.open(url,"imagePopUp","width=270,height=225,left=50,top=50") ;
}
used as follows
<a href="javascript:secWin('graphic1.html');"> image </a>
I hope someone can straighten this out for me. Thanks.
probably a really lame question.
I have a Web page with a series of graphics in it (window A).
Clicking on a graphic in A opens a small pop-up window (window B) over A.
If the visitor clicks on B, it closes.
If the visitor clicks back on A -- the page or a new graphic -- A comes
to the forefront and hides B.
If B remains open (visitor does not click on it) and visitor clicks on
another graphic on A, the contents of B are replaced by whatever the new
link points to (or the same if the same graphic is clicked on).
I can make all the above happen. What I can't figure out is how to set
the focus back on B, so that it comes to the forefront, after clicking
on a graphic in A. I've messed around with focus() in all sorts of ways
but can't get B to come back to the foreground. My attempts include
adding a focus statement in the page loading (graphic.html in the
example below).
This is what works:
function secWin(url) {
window.open(url,"imagePopUp","width=270,height=225,left=50,top=50") ;
}
used as follows
<a href="javascript:secWin('graphic1.html');"> image </a>
I hope someone can straighten this out for me. Thanks.