Solve the problem of hand Amoy lib-flexible.js the first load page page in the mobile side first enlarge after the normal issue

Source: Internet
Author: User

such as this

Then this

The reason for this is generally static, that is, there are some static in the HTML (that is, non-JS dynamically added)

If the page is dynamically added with JS after it has been loaded, the problem is not obvious,

function (e) {            = * DPR + ' px ';         false);

This code is the main role, but this code is executed after the page initialization (that is, the other reference to the JS file download, and the functions are initially completed),

In this way, in the moment of loading the page, we will see the page first zoom in, do not explain, too late, directly said the solution put.

Refreshrem ();     // doc.body.style.fontSize = * DPR + ' px ';    FLEXIBLE.DPR = WIN.DPR = DPR;     = Refreshrem;

1. in Refreshrem (), followed by doc.body.style.fontSize = * DPR + ' px '; this code,

2.

 <  body  >  <  script  type  = "Text/javascript"   src  = "Js/lib/flexible_css.js"  ></ script   >  <  script  type  = "Text/javascript"   src  = "Js/lib/flexible.js"  ></ script  >  

Put these two JS in the body of the head (), must be placed here,

otherwise doc.body.style.fontSize = * DPR + ' px '; We added this code will be an error, because the page may not have the BODY element



The last PS a sentence: the principle of this program is in the body just load up on the calculation of fontsize, such changes will not affect other aspects of my not too clear, please know the classmate, tell me, thank you

Solve the problem of hand Amoy lib-flexible.js the first load page page in the mobile side first enlarge after the normal issue

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.