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

yingwhoAsked:
Who is Participating?
 
geekedConnect With a Mentor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.