Javascript :window.open pop up window location problem

  • 2020-03-30 02:22:13
  • OfStack

The location of the window.open popup window
 
<SCRIPT LANGUAGE="javascript"> 
<!-- 
window.open ('page.html', 'newwindow', 'height=100, width=400, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=n o, status=no') //This sentence should be written in one line
--> 
</SCRIPT> 

 Parameter explanation:  

<SCRIPT LANGUAGE="javascript"> js Script starts;  
window.open  Command to pop up a new window;  
'page.html'  The name of the pop-up window;  
'newwindow'  The name of the pop-up window (not the file name) '' Instead of;  
height=100  Window height;  
width=400  Window width;  
top=0  The window is the pixel value at the top of the screen.  
left=0  The pixel value of the window to the left of the screen;  
toolbar=no  Whether to display toolbar, yes To display;  
menubar . scrollbars  Represents the menu bar and the scroll bar.  
resizable=no  Is it allowed to change the window size, yes To allow;  
location=no  Whether to display the address bar, yes To allow;  
status=no  Whether to display the information in the status bar (usually the file has been opened), yes To allow;  
</SCRIPT> js End of the script  

Echo - >
 
<html> 
<head> 
<script type="text/javascript"> 
function neww(){ 
var w=document.getElementById('w').value; 
alert(w); 
var h=document.getElementById('h').value; 
var hh=document.getElementById("hh").value; 
var v=document.getElementById('v').value; 
var style="directories=no,location=no,menubar=no,width="+w+"height"+h; 
var myFunc=window.open("http://www.baidu.com","nwindow",style); 
myFunc.moveTo(hh,v); 

} 
</script> 
</head> 
<body> 
 Height of new window: <input type="text" id="h" size="4" value="300" /> 
 Width of new window: <input type="text" id="w" size="4" value="300" /> 
 Vertical coordinates of the new window: <input type="text" id="hh" size="4" value="300" /> 
 Horizontal coordinates of the new window: <input type="text" id="v" size="4" value="300" /> 
<button onclick="new();"> Open the heart popover </button> 
</body> 
</html> 

Related articles: