window.open

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • akg
    New Member
    • Jan 2007
    • 19

    window.open

    Hi friends,
    I want to open a window with window.open method, but I want to set left and top coordinates in negative. but when i run this then it always open with positive top and left position. Please help me. its very urgent.

    code is like this:

    var options = 'height=670,wid th=654,status= no, resizable= no, scrollbars=yes, toolbar=no,loca tion=no,menubar =no,left=offset =-540,top=-20';

    var newwindow = window.open('HT MLPage1.htm','t eswindow',optio ns);

    Thanks,
    Amit
  • akg
    New Member
    • Jan 2007
    • 19

    #2
    please replace the options string with this one:

    var options = 'height=670,wid th=654,status= no, resizable= no, scrollbars=yes, toolbar=no,loca tion=no,menubar =no,left=-540,top=-20';

    even i am setting left and top and -ve value still my window is always opening in positive coordinate. Please help

    Thanks,
    Amit

    Comment

    • acoder
      Recognized Expert MVP
      • Nov 2006
      • 16032

      #3
      Why do you want to open in negative coordinates. That would take it out of the viewable screen. One option is
      Code:
      window.moveBy(-100,-100);
      Not perfect, but it moves the browser window left and top.

      Comment

      • pronerd
        Recognized Expert Contributor
        • Nov 2006
        • 392

        #4
        Originally posted by akg
        when i run this then it always open with positive top and left position.
        That is what it should do. Those values can not be negative since that would put the window off of the screen. Why would you open a JavaScript window no one can see?

        Comment

        Working...