Javascript| Web page | You can also design different pages for different screen resolutions to add to the attractiveness of the Web page. This way when users browse your Web page, it will match the screen resolution, automatically display a suitable page screen, not only to help users save the trouble of adjusting the screen resolution, but also for different resolution, adjust the page layout. Example, we designed 3 pages based on screen resolution, 640.html, 800.html and 1024.html, then we'll see how to design this program!
Copy the following program code first:
<script language= "Javascript" >
<!--
if (Screen.width = = "640")
{
location= "640.html"
}
else if (screen.width = "800")
{
location= "800.html"
}
Else
{
location= "1024.html"
}
-->
</script>
Then edit the HTML loose-leaf label, move the text input cursor to the position you want to appear in the Web page, press the [edit] on the menu, and click [Paste] to make this effect.
Now, let's take a look at the focus of this program:
This program mainly uses [if] judgment, check [screen.width] content, if it is [640], then display 640.html Web page, [800] then display 800.html Web page, if not, then display 1024.html page.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.