|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Pop-up window - bring to the front
Hi there!
When a user exits a pop-up window on my site and returns to the main page, the pop-up takes its place behind the main window. Is there a way to alter my existing pop-up script so that the pop-up will move forward when the originating link on the main page is clicked? Code:
<a href="#" class="paper" onClick="window.open('../popups/uno.html','MyWindow2','toolbar=no,location=no,dire ctories=no,status=no,menubar=no,scrollbars=no,resi zable=yes,width=400,height=515,left=5px,top=5px'); return false;">
<img alt="Paper" src="../images/TetonUno.jpg" height="89" width="88" border=
"0"></a>
Thanks - all suggestions appreciated. Robsta ![]() Last edited by robsta : August 18th, 2003 at 04:17 PM. |
|
#2
|
|||
|
|||
|
Re: Pop-up window - bring to the front
Someone helped me with this.
Here's the solution (actually, the guy who figured it out did it in a much smoother way than what you see here - let me know if you'd like me to post his code). I tweaked it to work with NS7Mac. Code: <a href="#" class="paper" onClick="var newWin = window.open('../popups/uno.html','MyWindow2','toolbar=no,location=no,dire ctories=no,status=no,menubar=no,scrollbars=no,resi zable=yes,width=400,height=515,left=5px,top=5px'); newWin.focus();return false;"> <img alt="Paper" src="../images/TetonUno.jpg" height="89" width="88" border= "0"></a> Robsta ![]() |
|
#3
|
||||
|
||||
|
Basically, the method you are (were) after is the handy: window.focus
You can call it from anywhere, and refer to any window that you created. mypopup.focus() this.focus() Side note, you can also use it on form objects, like text input. It places the cursor inside the object you call it on. e.g. document.forms[0].txt_username.focus() This is a great little trick to use when performing validation on a form, as it brings the user attention to the offending item quickly. Combine it with the 'select' method to really get their attention. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > Pop-up window - bring to the front |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|