JavaScript - Moz/FireFox - self.moveTo

  • Started
  • Last post
  • 0 Responses
  • murmur

    I have a simple script to reposition the window to the center of the screen. However, in Mozilla and FireFox on a Mac it will not reposition.

    The code works when i use a static value say "820". It will not work when i assign a variable instead of a numerical value.

    Anyone know a workaround?

    var w = 820
    var LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
    alert(LeftPosition);
    window.moveTo(LeftPosition,0);
    self.resizeTo(820,screen.availHe...
    self.focus;