How to enable the maximize and restore button of the popup window using Javascript?
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- void before promise syntax
- Keeping track of variable instances
- Can php detect if javascript is on or not?
You can't, sorry - at least, not universally. The popup is implementation-dependent and there aren't any standard JavaScript methods for controlling it in the manner you describe.
Using the code I pasted on the bottom, you can emulate these buttons by creating them in your website interface.
To maximise: save the current position with
Namespace.outerPositionGet()
and size withNamespace.outerSizeGet()
, then doNamespace.outerPositionSet({left:0,top:0})
andNamespace.outerSizeSet({width:window.screen.availWidth, height:window.screen.availHeight})
.To restore: just set position and size which were saved when maximising.
You have to open a popup like this:
The trick is to make the window resizable. Search for the window.open() function documentation.
try this also. its working for me...
I'm assuming you're talking about the alert popup? This can't be done with standard JavaScript.
You best solution would be to try using some of the many popup solutions that have been developed for the various JavaScript frameworks (e.g. jQuery), and seeing if you can tailor this to your particular use.