Laurent Bugnion, GalaSoft wrote:
[color=blue]
> Hi,
>
> marcy wrote:
>[color=green]
>> "Laurent Bugnion, GalaSoft" <galasoft-LB@bluewin_NO_SPAM.ch> wrote in
>> message news:3F042498.9060806@bluewin_NO_SPAM.ch...
>>[color=darkred]
>>> Hi,
>>>
>>> Carol Lyn wrote:
>>>
>>>> Could use your assistance with this. I have a window that opens via
>>>> onclick and it is a small window with info about a site. If the user
>>>> is interested in visiting that site, there is a link to click that
>>>> opens the site in a new and larger window via onclick. My question
>>>> is, can I have the smaller window automatically close when the user
>>>> clicks the link to visit the site? I also have a link that merely
>>>> closes the smaller info window if the user is not interested in
>>>> visiting the site.
>>>>
>>>> TIA
>>>
>>>
>>> To load the link in the main window and close the small window, do:
>>>
>>> <A HREF="newLocation.html"
>>> ONCLICK="opener.location=this.href;top.close()retu rn false;">
>>> Click here</A>[/color][/color]
>
>
> Forgot a ';' here. Should be
>
> <A HREF="newLocation.html"
> ONCLICK="opener.location=this.href;top.close();ret urn false;">
> Click here</A>
>[color=green][color=darkred]
>>>
>>> Of course, this won't work if JavaScript is not enabled.
>>>
>>> Laurent[/color]
>>
>>
>>
>> Hello. Could this procedure also include window options, specifically,
>> resizing the main window to be larger than the smaller info window that
>> closes?
>>
>> Cheers,[/color]
>
>
> Before I show you how to do this, note that noone likes his browser
> window to be resized. I strongly advocate against doing this.
>
> However, it is technically possible to resize a window from another one,
> with
>
> windowRef.resizeTo( WIDTH, HEIGHT );
>[/color]
In NS 6.2+ and Mozilla-based browsers (NS 6.2+, K-meleon, Phoenix,
Firebird, Beonex, etc.), there is an user setting disableing,
neutralizing the recourse to resizeTo. So, resizeTo() can not be
considered as a reliable method. I personally always have this setting
turning off resizeTo() calls.
Not to mention that Bugzilla has also enhancement requests where the
user will utlimately have more control over and absolute veto over the
javascript requests of web developers over window dimensions. I
wholeheartedly agree with these people since a web developer has no idea
how big/small is a monitor screen, how acute is the eye vision of an
user, how crowded is the window screen, etc.. and this is outside his
range and control. Leave the window sizes to the only person who will be
using that window: the user. He's the best person to know what's the
best window size for his needs.
[color=blue]
> For example:
>
> <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
> <!--
>
> function closeAndResize( iWidth, iHeight, strNewLoc )
> {
> opener.location = strNewLoc;
> opener.resizeTo( iWidth, iHeight );
> top.close();
> }
>
> //-->
> </SCRIPT>
>
> <A HREF="http://www.galasoft-LB.ch"
> ONCLICK="closeAndResize( 600, 800, this.href );return false;">[/color]
On a 800x600 scr. res. - which is the most popular scr. res. - , the
above instruction, if it succeeds, will create a 600x572 window because
the requested 800 height will not fit within the available workarea for
application. That's just a good - unintentional - example here why it is
not recommendable to try to control the window dimensions.
[color=blue]
> Click here</A>
>
> Don't use it ;-)
>
> Laurent[/color]
DU
--
Javascript and Browser bugs:
http://www10.brinkster.com/doctorunclear/