I have a site that has thumbnail images and when you click the thumbs a pop-up shows the enlarged photo. When you click the next thumb, the pop-up goes under the main window (because we clicked on main window for next thumb). The 2nd photo loads in the pop window but that pop window remains under the main window. You have to go hunt for it in your start menu. Is there a way to force the pop-up to remain the front window, even after clicking the main window? Perhaps a snippet of Java that will do this.
Javascript. You can't force the popup to stay on top but you can bring it back to the top if the user clicks a 2nd thumbnail. You need to name the popup window when you first open it, then use the window.focus method after opening it. Example: http://www.quirksmode.org/js/popup.html
Can't seem to get that to work What do you mean by name the window first? EDIT: This works for IE self.focus(); But not in FF
I threw together some minimal code that should do what you want. Have a look at the window.open method: http://www.devguru.com/technologies/ecmascript/quickref/win_open.html and the window.focus method: http://www.devguru.com/technologies/ecmascript/quickref/window.html <html> <head><title>test</title> <script type="text/javascript"> // you can use the yourimage parameter to decide which image to display // I'm not using it and just included it for reference function opener(yourimage) { // open the popup newwindow = window.open('http://forums.digitalpoint.com', 'winviewer', 'height=200,width=150'); // make sure popup is on top if (window.focus) {newwindow.focus();} return false; } </script> </head> <body> <a href="#" onclick="return opener('a')">test a</a> <a href="#" onclick="return opener('b')">test b</a> </body> </html> Code (markup):
I meant instead of doing: window.open Code (markup): to do: thename = window.open Code (markup): so you could then use thename in your focus method.