View Full Version : Keep pop-up window on top
mjackson
09-26-2002, 10:45 PM
After much searching, I have found that below is the only way I can open a pop-up window on my page...
<a href="http://www.sharonmorrowdesigns.com/sterling_rings/strrng301.htm" onClick="window.open(this. href,'Sterling','scrollbars=no,width=275,height=37
5'); return false"
I have numerous pages that need to be opened and have tried using functions, and for some reason, they will not open my new pages. I would like to keep the new windows on top, with content changing. I have tried to place the focus information in the new window, but that keeps that page on top, not just the window. How do I keep the window on top using the script I have above? Is it possible?
chrismiceli
09-27-2002, 02:01 AM
did you try this, sry if you already did and i didn't catch it while reading
function test() {
window.open("url", "STERLING", options)
window.STERLING.focus()
}
<a href="url" onClick="test()">
glenngv
09-27-2002, 02:15 AM
Originally posted by chrismiceli
did you try this, sry if you already did and i didn't catch it while reading
function test() {
window.open("url", "STERLING", options)
window.STERLING.focus()
}
<a href="url" onClick="test()">
it should be:
function test() {
winSterling = window.open("url", "STERLING", options)
winSterling.focus()
}
window target is different with window object handle.
mjackson
09-27-2002, 02:31 PM
Thank you for the help, but that still won't work. Following is a url to the site I'm working on, http://www.sharonmorrowdesigns.com/sterling_silver_rings.htm . The first ring is the script that I already had. It worked great...other than I can't get the window to stay on top. For some reason, I have NO IDEA why:confused: , whenever I try to use a function to call up the window, my webpage won't open. The window will open, but the page can't be found. The second and third rings are the ones using the function. Anybody got any suggestions?
Have a mess around with this:
<script>
setTimeout("win1=window.showModelessDialog('page.htm','aaa','dialogHeight: 200px; dialogWidth: 200px; dialogTop: 50px; dialogLeft: 0px; edge: Sunken; center: No; help: Yes; resizable: No; status: Yes;');win1.document.write('Win1')",1000)
setTimeout("win2=window.showModelessDialog('page.htm','bbb','dialogHeight: 200px; dialogWidth: 200px; dialogTop: 50px; dialogLeft: 550px; edge: Raised; center: Yes; help: Yes; resizable: Yes; status: Yes;');win2.document.write('Window number 2');three()",2000)
function three(){
win3=window.showModelessDialog(' ','','dialogHeight: 200px; dialogWidth: 200px; edge: Sunken; center:Yes; help:No; resizable: Yes; status: Yes;scroll:no')
win3.document.write("You can load a page into this window or dynamically write to it<P>Click on the parent window and notice that this window becomes unfocused yet remains on top.<P>You can still select a link from the left navbar or highlight text.<P>You can also include links in this window which will load into a new window, or target window for frames. <P><A href='../popup/note4.htm' target=header><b>Click to see</b></a>")
}
</script>
mjackson
09-27-2002, 03:40 PM
Would the above script be put in the header? If so, what would I use for my link? Also, should I use the entire script or are they three separate examples? This is just a little more complicated than what I'm used to. I would be very grateful if it works, though. I just want to make sure I'm using it correctly.
Sorry ... yes.. they were just examples of what you could achieve.
The following script can be placed in the header
<script language="javascript">
<!--
function OpenWin(){
win3=window.showModelessDialog('YOURPAGE.HTM','','dialogHeight: 200px; dialogWidth: 200px; edge: Sunken; center:Yes; help:No; resizable: Yes; status: Yes;scroll:no')
}
// -->
</script>
CHANGE YOURPAGE.HTM to your own
THEN use the link below to open the window
<a href="javascript:OpenWin()">Open Popup</a>
For now you will have to create a separate function for each window you want to open, as passing the file name as an argument does not appear to work ... yet
mjackson
09-27-2002, 09:09 PM
Thank you for your help. I used a newWindow generator by eaks...http://www.eak.homeip.net/newwindowgenerator.html. It has solved my problem. Thank you all for all your wonderful help, though. I really appreciate it.
Sorry......... I must have misunderstood I thought you wanted the popups to remain in focus
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.