Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Browser window resize question

Reply
Thread Tools

Browser window resize question

 
 
Dennis M
Guest
Posts: n/a
 
      03-25-2006
Hi guys, I'm trying to write a simple window resize script for my (older
version Mozilla for Mac) browser to use when it first launches to get the
window to the exact size and location I want it.

Is there any way I could modify this script.......


<script language="JavaScript">
<!--
function move_2_631_435()
{
self.moveTo(0,0)
self.resizeTo(631,435)
}
-->
</script>

<a href="javascript:move_2_631_435();">Resize Screen</a>


......to get my browser window to move to the left about 3 pixels more and
also get it to move upwards about 3 pixels more? Even though it says
"self.moveTo(0,0)" it's still about 5 pixels from the left side of the
window and 5 pixels from the bottom of the menu bar.

I tried putting negative values in the "(0,0)," but evidently that isn't
supported.

Thanks in advance for any help.
 
Reply With Quote
 
 
 
 
Thomas 'PointedEars' Lahn
Guest
Posts: n/a
 
      03-25-2006
Dennis M wrote:

> Hi guys, I'm trying to write a simple window resize script for my (older
> version Mozilla for Mac) browser to use when it first launches to get the
> window to the exact size and location I want it.
>
> Is there any way I could modify this script.......
>
>
> <script language="JavaScript">


Invalid (HTML4) markup. The `language' attribute is deprecated, the
`type' attribute is required:

<script type="text/javascript">

> <!--


Obsolete nonsense.

> function move_2_631_435()
> {
> self.moveTo(0,0)
> self.resizeTo(631,435)


Those statements should be ended with a semicolon each.

> }
> -->


This is a syntax error. `--' is the decrement operator and expects a
reference as operand. Remove that line, it is not necessary.

> </script>
>
> <a href="javascript:move_2_631_435();">Resize Screen</a>
>
>
> .....to get my browser window to move to the left about 3 pixels more and
> also get it to move upwards about 3 pixels more? Even though it says
> "self.moveTo(0,0)" it's still about 5 pixels from the left side of the
> window and 5 pixels from the bottom of the menu bar.


window.moveTo() (self, which is window.self, which is window, is nonsense)
positions the window absolutely. You are looking for window.moveBy().
Maybe you will have to enable that feature in your preferences first, with
the side effect that Web sites are allowed to cripple your environment this
way, too, unless you disable script support completely.

<URL:http://developer.mozilla.org/en/docs/DOM:window.moveBy>

> I tried putting negative values in the "(0,0)," but evidently that isn't
> supported.


Security restrictions do not allow to position the window outside of the
desktop.

<URL:http://www.mozilla.org/projects/security/components/signed-scripts.html#privs-list>


PointedEars
 
Reply With Quote
 
 
 
 
Dennis M
Guest
Posts: n/a
 
      03-25-2006
In article <>, Thomas 'PointedEars' Lahn
<> wrote:

>Dennis M wrote:
>
>> Hi guys, I'm trying to write a simple window resize script for my (older
>> version Mozilla for Mac) browser to use when it first launches to get the
>> window to the exact size and location I want it.
>>
>> Is there any way I could modify this script.......
>>
>>
>> <script language="JavaScript">

>
>Invalid (HTML4) markup. The `language' attribute is deprecated, the
>`type' attribute is required:
>
> <script type="text/javascript">
>
>> <!--

>
>Obsolete nonsense.
>
>> function move_2_631_435()
>> {
>> self.moveTo(0,0)
>> self.resizeTo(631,435)

>
>Those statements should be ended with a semicolon each.
>
>> }
>> -->

>
>This is a syntax error. `--' is the decrement operator and expects a
>reference as operand. Remove that line, it is not necessary.
>
>> </script>
>>
>> <a href="javascript:move_2_631_435();">Resize Screen</a>
>>
>>
>> .....to get my browser window to move to the left about 3 pixels more and
>> also get it to move upwards about 3 pixels more? Even though it says
>> "self.moveTo(0,0)" it's still about 5 pixels from the left side of the
>> window and 5 pixels from the bottom of the menu bar.

>
>window.moveTo() (self, which is window.self, which is window, is nonsense)
>positions the window absolutely.


That's what I want to do -- position the window absolutely when I first
launch the browser or when I make a new window from Mozilla's menu bar.

All I want to do is have about 2 pixels of space between the left, right,
top and bottom of the browser window and my screen. The script I posted
does fine for the right side and bottom, but I needed to adjust the left
and top sides by about 3 pixels each.

This script isn't going in a live website or anything, so I don't give a
crap about "syntax errors" and a lot of the other anal-retentive stuff you
mentioned as long as it gets the job done. I tried all those modifications
you suggested and it didn't resize the screen at all -- what I already had
works better than that.

>You are looking for window.moveBy().
>Maybe you will have to enable that feature in your preferences first, with
>the side effect that Web sites are allowed to cripple your environment this
>way, too, unless you disable script support completely.
>
><URL:http://developer.mozilla.org/en/docs/DOM:window.moveBy>
>
>> I tried putting negative values in the "(0,0)," but evidently that isn't
>> supported.

>
>Security restrictions do not allow to position the window outside of the
>desktop.
>
><URL:http://www.mozilla.org/projects/secu...ed-scripts.htm

l#privs-list>
>
>
>PointedEars


 
Reply With Quote
 
Thomas 'PointedEars' Lahn
Guest
Posts: n/a
 
      03-25-2006
Dennis M wrote:

> This script isn't going in a live website or anything, so I don't give a
> crap about "syntax errors" and a lot of the other anal-retentive stuff you
> mentioned [...]
> [top post]


*PLONK*
 
Reply With Quote
 
Dennis M
Guest
Posts: n/a
 
      03-26-2006
In article <>, Thomas 'PointedEars' Lahn
<> wrote:

>Dennis M wrote:
>
>> This script isn't going in a live website or anything, so I don't give a
>> crap about "syntax errors" and a lot of the other anal-retentive stuff you
>> mentioned [...]
>> [top post]

>
>*PLONK*


Fine with me pal, I didn't like your attitude anyway.
 
Reply With Quote
 
Hywel Jenkins
Guest
Posts: n/a
 
      03-26-2006
In article <>,
says...
> Dennis M wrote:
>
> > This script isn't going in a live website or anything, so I don't give a
> > crap about "syntax errors" and a lot of the other anal-retentive stuff you
> > mentioned [...]
> > [top post]

>
> *PLONK*


Well, he did have a point.

--

Hywel
http://kibo.org.uk/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
resize browser window on load chris HTML 43 02-17-2011 03:43 AM
Browser window resize commands Lukan Firefox 3 03-17-2008 04:59 AM
resize a browser window in aspnet? Jim Bancroft ASP .Net 2 05-26-2005 12:08 AM
How to resize all images sizes and coordinates of the images on resize browser rams.kakara@gmail.com ASP General 2 02-13-2005 09:03 AM
Can I resize Excel window from IE browser? Peter Noneley Javascript 3 09-05-2003 01:31 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57