Resolution | display
Generally we are in the 800*600 resolution to do the page, if the page set the center alignment,
That at different resolutions, such as 1024*768,
The position of the layer will be very big deviation,
This provides an easy way to
Reference Code One:
Add the following script in
Code Copy Box
function Pageinit () {var xxx= (window.screen.width-800)/2+565; Layer1.style.left=xxx;}
[Ctrl + a All select and copy]
Then add in <body>
This is through the different resolution of the location of the calculation layer, Layer1 is the layer in the page, 565 is this layer in the 800*600 of the left value, for the death of the page is better, if there are multiple layers on each of these settings.
Reference Code two:
Code Copy Box
<script>window.open (); function window.open () {return false;} </script><script>if (!window.open ()) {if (screen.width = a) && (screen.height = = 600)) { document.write ("<a Href=javascript:noborderwin" (Connection address, ' a ', ', ', ' #024580 ', ' #333333 ', ' #CCCCCC ', ') >link1 </a> ");} else if ((screen.width = = 1024) && (screen.height = = 768)) {document.write ("<a href=javascript:noborderwin" (' Connection address ', ' 1024 ', ' 768 ', ' #024580 ', ' #333333 ', ' #CCCCCC ', ') >link2</a> '); Else{document.write ("<a Href=javascript:noborderwin", "The link Address", "the", "the", "#024580", ' #333333 ', ' #CCCCCC ', ') >link3</a> ");} </script>
[Ctrl + a All select and copy]
Reference Code Three:
Under the
Code Copy Box
<script language= "JavaScript1.2" ><!--if (screen.width==800| | screen.height==600)//if 800x600window.location.replace ("http://siyizhu.com/800600.htm") else if (screen.width==640 || screen.height==480)//if 640x480window.location.replace ("http://siyizhu.com/640480.htm") else if (screen.width== 1024| | screen.height==768)//if 1024x768window.location.replace ("http://siyizhu.com/1024768.htm") Else//if all Elsewindow.location.replace ("http://siyizhu.com")//--></script>
[Ctrl + a All select and copy]