JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old August 18th, 2003, 01:19 PM
robsta robsta is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Pacific NW, U.S.A.
Posts: 146 robsta User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
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 03:17 PM.

Reply With Quote
  #2  
Old August 19th, 2003, 08:52 PM
robsta robsta is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Pacific NW, U.S.A.
Posts: 146 robsta User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
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

Reply With Quote
  #3  
Old August 20th, 2003, 08:43 AM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 6 m 11 sec
Reputation Power: 8
Send a message via ICQ to stumpy Send a message via MSN to stumpy
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.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > Pop-up window - bring to the front


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway