When making the page, the user requests, the different resolution, the pop-up window position is different, I thought is not first obtains the screen width, then pays the value to the variable, then sets the parameter in the onclick
Copy Code code as follows:
<script>
Alert (screen.width+ "*" +screen.height)
</script>
Copy Code code as follows:
<script>
function CenterWindow (url,w,h) {
L= (screen.width-w)/2
t= (screen.height-h)/2
window.open (URL, ', ' left= ' +l+ ', top= ' +t+ ', width= ' +w+ ', height= ' +h ')
}
</script>
<input Type=button onclick= "CenterWindow (' About:blank ', 200,200)" >
---------------------------------------------------------------
<body>
<script language= "JavaScript" >
var s = "Web page visible area wide:" + document.body.clientWidth;
s+= "\ r \ n page visible Area High:" + document.body.clientHeight;
s + + "\ r \ n page text full text width:" + document.body.scrollWidth;
s + + "\ r \ n" page full text High: "+ document.body.scrollHeight;
s + + "\ r \ n Page body part:" + window.screentop;
s + + "\ r \ n Page body part left:" + window.screenleft;
s + + "\ r \ n screen resolution of High:" + window.screen.height;
s + + "\ r \ n Screen resolution width:" + window.screen.width;
s + = "\ r \ n Screen available working area height:" + window.screen.availHeight;
s + = "\ r \ n Screen available working area width:" + window.screen.availWidth;
alert (s);
</SCRIPT>
---------------------------------------------------------------
<script language= "JavaScript" >
<!--Begin
function Redirectpage () {
/*var url640x480 = "http://www.yourweb.com/640x480.html"; * * Remember to change the corresponding page * *
var url800x600 = "index1.asp";
var url1024x768 = "index2.asp";
/*if ((Screen.width = = 640) && (screen.height = = 480))
window.location.href= url640x480;*/
if (screen.width <= 800)
Window.location.href= url800x600;
else if ((screen.width >= 1024))
Window.location.href= url1024x768;
}
End-->
</script>
This code shows different pages based on different screens.
The following is the parameter passed
Copy Code code as follows:
<script language=javascript>
document.write ("<a href= ' webstat/index.asp ' >");
document.write ("
&width= "+escape (screen.width) +" &height= "+escape (screen.height) +
"' Border=0 width=1 height=1>");
document.write ("</a>");
</script>