初始为新媒体h5页

public.js 582B

1234567891011121314151617181920
  1. document.documentElement.style.fontSize = 100 * (document.documentElement.clientWidth / 375) + "px";
  2. window.onresize = function () {
  3. document.documentElement.style.fontSize = 100 * (document.documentElement.clientWidth / 375) + "px";
  4. }
  5. // 获取地址栏信息
  6. function getQueryUrl () {
  7. let url = window.location.href;
  8. let result = {};
  9. if (url.indexOf('?') > -1) {
  10. let str = url.split('?')[1];
  11. let temp = str.split('&');
  12. for (let i = 0; i < temp.length; i++) {
  13. let temp2 = temp[i].split('=');
  14. result[temp2[0]] = temp2[1]
  15. }
  16. }
  17. return result
  18. }