• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 271
  • Last Modified:

window size


minimizing the window throws a prompt and if OK button is clicked the window maximizes.
the problem is its not utlizing the total monitor space, pl correct it.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
 <head>
 <script>
 function buy() {
                var answer = confirm ("Do you want to buy?")
                if (answer)
                window.location.href="http://www.buy.com";
                window.innerWidth = screen.width;
				window.innerHeight = screen.height;
				window.screenX = 0;
				window.screenY = 0;
                } 
 var isMin = false;
 function detectMinMax()
        {
      if(!isMin&&((window.screenLeft&&window.screenLeft==-32000)||(window.screenX&&window.screenX==-32000)))
           {
           isMin = true;
           buy();
                }
        }
setInterval('detectMinMax()', 500);
</script>
</head>
 <body> 
 buy
 </body>
</html>

Open in new window

0
yingwho
Asked:
yingwho
  • 2
1 Solution
 
geekedCommented:
Give this a try. I'm not a JavaScript expert though. I might not be able to answer your questions.


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<script type="text/javascript">
 function buy() {
                var answer = confirm ("Do you want to buy?");
                if (answer)
                {window.location.href="http://www.buy.com";
                window.innerWidth = screen.width;
                                window.innerHeight = screen.height;
                                window.screenX = 0;
                                window.screenY = 0;
                                window.resizeTo(screen.width,screen.height);}
                } 
 var isMin = false;
 function detectMinMax()
        {
      if(!isMin&&((window.screenLeft&&window.screenLeft==-32000)||(window.screenX&&window.screenX==-32000)))
           {
           isMin = true;
           buy();
                }
        }
setInterval('detectMinMax()', 500);
</script>
<title></title>
</head>
<body>
buy
</body>
</html>

Open in new window

0
 
jake_0011Commented:
Modern browsers have this setting disabled by default.  The user must choose to enable these features.
In firefox under "Tools-->Options-->Content-->JavaScript(Advanced)-->Move or Resize Existing Windows"
0
 
yingwhoAuthor Commented:
jake, i am not sure abt the solution. lets wait for other answers
0
 
yingwhoAuthor Commented:
geek, great solution. sorry for the delay.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now