In message <zy***************@news2.mts.net> - "Grant Wagner"
<gw*****@agricoreunited.com> writes:
:>
:>"rob" <gr***********@rcp.ca> wrote in message
:>news:11*************@corp.supernews.com...
:>> In message <MP************************@nntp.lucent.com> - kaeli
:>> <ti******@NOSPAM.comcast.net> writes:
:>> :>
:>> :>In article <11*************@corp.supernews.com>,
:>>
gr***********@rcp.ca
:>> :>enlightened us with...
:>> :>>
:>> :>> <Body bgcolor='black' Text='#dbdbdb'
:>> onblur='window.resizeTo(150,150)'
:>> :>> onfocus='window.resizeTo(150,300)'>
:>> :>>
:>> :>
:>> :>In case you weren't aware, Opera and Mozilla/Firefox have options to
:>> prevent
:>> :>window resizing. Window resizing causes problems in tabbed browsers
:>> if I open
:>> :>the document in a tab when you assumed I was opening it in its own
:>> window;
:>> :>the code ends up resizing ALL my open tabs. Very irritating.
:>> :>And ALL new windows open in tabs for me and anyone else who sets
:>> their
:>> :>Firefox to do that. Opera may have a similar option.
:>> :>
:>> :>As to the problem, you may want to change window.resizeTo to
:>> self.resizeTo in
:>> :>the onBlur. That's all I can think of.
:>>
:>> I've been doing some testing on a variety of systems and the only
:>> combination
:>> that doesn't resize properly is XP Pro (sp2) with IE6 (sp2). The sp1
:>> levels
:>> work fine as do older versions of Windows & IE. Personally, I prefer
:>> Mozilla
:>> anyway.
:>>
:>> If I change window.resize to window.close and load it into an sp2
:>> system, then
:>> the window closes as expected. Seems to be something about sp2 that
:>> doesn't
:>> like a window.resize being called by an onblur.
:>>
:>> Here's my test page....
:>>
:>> <!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
:>> <Html>
:>> <Head>
:>> <Title>blur test</Title>
:>> </Head>
:>> <Body onblur="window.resizeTo(150,150)"
:>> onfocus="window.resizeTo(150,300)">
:>>
:>> this is a test window
:>>
:>> </Body>
:>> </Html>
:>
:>Yup, you're right, IE 6.0.2900 doesn't allow that, so don't do it.
:>
:>While this behaviour is not specifically addressed at <url:
:>
http://www.microsoft.com/technet/pro...rows.mspx#ECAA
:>/>, it's easy enough to see how moving and resizing a window after a
:>user moved off it could be considered a malicious use of script. You
:>could mess around with the user such that everytime they moved off a
:>window, you could resize and move it, so the user wouldn't know where on
:>their desktop to find the window the next time they wanted to look at it
:>
:>Consider the following script:
:>
:><script type="text/javascript">
:>window.onblur = function()
:>{
:> window.moveTo(
:> Math.random() * screen.availWidth,
:> Math.random() * screen.availHeight
:> );
:> window.resizeTo(
:> Math.random() * screen.availWidth,
:> Math.random() * screen.availHeight
:> );
:>}
:>var t = setInterval('window.blur()', 50);
:></script>
:>
:>The constant window.blur() makes it impossible to bring focus to the
:>window, and the constant moving and resizing prevents clicking the close
:>icon.
:>
:>Quite frankly, you don't get much of a "window roll up" effect anyway,
:>since the browser continues to show it's toolbar(s), address bar and
:>status bar.
:>
:>--
:>Grant Wagner <gw*****@agricoreunited.com>
:>comp.lang.javascript FAQ -
http://jibbering.com/faq
:>
:>
Thanks for the info and the link (it made for an interesting read).
I showed some friends what I was trying to do, they went "yuck" and I went
hmmmm-maybe this isn't a good idea after all.
Thanks
Rob