View Full Version : Window not floating -what's wrong with script?
Lesley
11-30-2002, 03:03 PM
I am using the following script...
<script type="text/javascript" language="JavaScript"><!--
function minipage(page) {
window_handle = window.open(page,'scratchpad','width=700,height=20,scrollbars=yes,location=no,directories=no,status= no,menubar=no,toolbar=no,resizable=no alwaysRaised=true');
window_handle.focus();
}
//--></script>
It works except that the window disappears when another window is clicked. Am I using 'alwaysRaised' correctly? I know some browsers will not recognise this, but I am using IE v6 - so I believe it should ! I am still feeling my way round Javascript - so be gentle with me !
Thanks for any help - Lesley
brothercake
11-30-2002, 04:18 PM
I've never heard of "alwaysRaised" ...?
What it sounds like you want is a modalDialog. As much as I'm conceptually opposed to them ... then info is at http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/methods/showmodaldialog.asp
pilla
11-30-2002, 07:16 PM
alwaysRaised
The window will always appear above other windows
Try changing to:
<script type="text/javascript" language="JavaScript"><!--
function minipage(page) {
window_handle = window. open(page,'scratchpad','width=700,height=20,scrollbars=yes,location=no,directories=no,status=no,menu bar=no,toolbar=no,resizable=no,alwaysRaised=yes');
window_handle.focus();
Lesley
12-01-2002, 07:11 AM
Thank you Pilla.
I had not noticed the missing comma ! Naughty me !
However, the script still doesn't keep the window in front, whether I use 'true' or 'yes' - as this is, I believe, a boolean value presumably either, or even '1' should work?
Oh, oh !
Just read somewhere that this works for Mozilla only. Anyone any ideas for a more multi-browser compliant way to do it ?
Jeepers
12-01-2002, 12:53 PM
Personally, I think forcing a window to stay on top of what ever else is on the screen is wrong, it's like going full screen and chromeless, I know you can't do it now with the latest browsers, so that's good.
However, why not use an absolutley positioned <div> that is initially hidden, when required unhide it, it will then be over your page, you'll still be able to open other windows over it, but at the end of the day that is what the internet is all about, choice to do what you want to do and not what the programmer insists (maybe Microsoft could take a lesson here) and you've always got alert boxes as a last resort
Lesley
12-02-2002, 09:59 AM
Jeepers -
I take your point on misuse.. however that surely depends what your use is.
In my case, I am using a small popup window judiciously placed to act as a note pad for course notes. It is better if the user does not have to go find it each time it is needed, so I want it to be on top, without affecting the operation of the main page.
I am not sure that your idea for using <div> would accomplish this- after all, if it has to been 'unhidden' this would be no different from clicking the window's icon on the system bar. This isn't a case of 'user choice', (the window can be closed at any time and isn't in the way) I am just trying to employ a means to make it 'user friendly'. As for Microsoft - well in this case, I can do it in Netscape, but not IE - perhaps it is a pity that they cannot get their act together and use the same functions and give us all a break!
skeatt
12-02-2002, 11:05 AM
I've seen others use a way by using a setTimeout() method and focus()
or maybe something like onblur()......focus()
but you would get a momentary switch.
This type of effect would be great for a remote to control other pages, that way it doesn't get lost beneath other windows which would render the remote useless.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.