Got a small problem....
I've got a set of images as thumbnails, when I click on one it opens up a new window (only a small one) with the bigger size of that pic showing, should I click on another thumbnail before closing the window it displays the new image in the same window only now its not visible (unless you click on it on the taskbar). I want it so that when I click on a new window it brings that back to the front so the view can see it easily.
Is it possible?
I've tried searching for a piece of code for it but its just returning pop up scripts and the like
Thanks
Martin
? HTML - Bring window to front ?
-
- Posts: 661
- Joined: Thu 11 Sep, 2003 20.03
- Location: West Midlands
This is browser and OS controlled, by default it's a "first come first served" situation, although in my experience IE6 seems to overrule this at times especially so far as forms are concerned and Windows seems to forget about it full stop. One can alter this behaviour with TweakUI and prevent focus stealing.Martin wrote:I've got a set of images as thumbnails, when I click on one it opens up a new window (only a small one) with the bigger size of that pic showing, should I click on another thumbnail before closing the window it displays the new image in the same window only now its not visible (unless you click on it on the taskbar). I want it so that when I click on a new window it brings that back to the front so the view can see it easily.
Therefore, if you have a small window behind the main window, it should not come forward. One can see this action with Outlook Express, if you click a link in a message to open a new window and then click another link it opens in the same window but doesn't (usually) steal focus, yes?
That'll be because it is exactly what you want. It is simply a popup script, which is not a "stick this in front of the browser if it's not already open" script. Generally a new poppy-up window will appear in front of the main window if it isn't already open unless it's been defined as a pop behind window. It's then generally not the script's problem if the window it's trying to open is behind the current window as it's only concerned with opening it. You may be able to get it to grab the focus but not really recommended IMO.I've tried searching for a piece of code for it but its just returning pop up scripts and the like
Does anyone know where I can get a popup script like the ones used on this page that resizes according to the size of the image being displayed?
Don't know if this will be of any use to you...http://javascript.internet.com/page-det ... iewer.htmlChris wrote:Does anyone know where I can get a popup script like the ones used on this page that resizes according to the size of the image being displayed?
Found it while trying to solve my problem.
Thanks for that.Neil Jones wrote:This is browser and OS controlled, by default it's a "first come first served" situation, although in my experience IE6 seems to overrule this at times especially so far as forms are concerned and Windows seems to forget about it full stop. One can alter this behaviour with TweakUI and prevent focus stealing.Martin wrote:I've got a set of images as thumbnails, when I click on one it opens up a new window (only a small one) with the bigger size of that pic showing, should I click on another thumbnail before closing the window it displays the new image in the same window only now its not visible (unless you click on it on the taskbar). I want it so that when I click on a new window it brings that back to the front so the view can see it easily.
Therefore, if you have a small window behind the main window, it should not come forward. One can see this action with Outlook Express, if you click a link in a message to open a new window and then click another link it opens in the same window but doesn't (usually) steal focus, yes?
That'll be because it is exactly what you want. It is simply a popup script, which is not a "stick this in front of the browser if it's not already open" script. Generally a new poppy-up window will appear in front of the main window if it isn't already open unless it's been defined as a pop behind window. It's then generally not the script's problem if the window it's trying to open is behind the current window as it's only concerned with opening it. You may be able to get it to grab the focus but not really recommended IMO.I've tried searching for a piece of code for it but its just returning pop up scripts and the like
I've found this script http://javascript.internet.com/page-det ... indow.html
Seems exactly what I need, although it will keep the window open permenantly but that wouldnt matter if it meant the user closed it each time, only problem is how do I get it out of a button and into the standard way of linking through an image?
From:
<INPUT TYPE="BUTTON" VALUE="Pop-Up" onClick="topWindow()">
Into (current method):
<a href="javascriptStart('http://www.)";>
-
- Posts: 661
- Joined: Thu 11 Sep, 2003 20.03
- Location: West Midlands
Use this for a text link:Martin wrote:I've found this script http://javascript.internet.com/page-det ... indow.html
Seems exactly what I need, although it will keep the window open permenantly but that wouldnt matter if it meant the user closed it each time, only problem is how do I get it out of a button and into the standard way of linking through an image?
From:
<INPUT TYPE="BUTTON" VALUE="Pop-Up" onClick="topWindow()">
Into (current method):
<a href="javascriptStart('http://www.)";>
Code: Select all
<a href="javascripttopWindow()">Open on top</a>
Code: Select all
<a href="javascripttopWindow()"<img src="image.gif" border="0" /></a>
add onload="opener.blur; self.focus()" to your <body... > tag.
Alternatively on the window where you click to launch up the window define the window previously (call it newwin) and then in the open window function apply a function newwindow(x), in the function {newwin.close(); window.open(""+x+"",newwin,[attributes]);}
Alternatively on the window where you click to launch up the window define the window previously (call it newwin) and then in the open window function apply a function newwindow(x), in the function {newwin.close(); window.open(""+x+"",newwin,[attributes]);}