PageSourceSearch

https://www.shfe.com.cn/images/ydui.flexible.js

js shfe.com.cn collected 2026-10-02 07:01:51 UTC 2,145 bytes, 63 lines download raw bytes

1/**
2 * 可伸缩布局方案
3 * rem计算方式:设计图尺寸px / 100 = 实际rem  例: 100px = 1rem
4 */
5! function (window) {
6  var docWidth = 375;
7  var rootHtml = document.documentElement,
8    deviceWidth = rootHtml.clientWidth,
9    resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize';
10  var doc = window.document,
11    docEl = doc.documentElement;
12
13  if (deviceWidth < 750) {
14    var recalc = (function refreshRem() {
15      docEl.style.fontSize = (100 / docWidth * deviceWidth).toFixed(1) + 'px';
16      return refreshRem;
17    })();
18    window.removeEventListener(resizeEvt, recalc);
19  }
20
21  window.removeEventListener('resize', resizeBaseFontSize);
22  window.removeEventListener('orientationchange', resizeBaseFontSize);
23  if (deviceWidth < 750) {
24    PhoneResize()
25    if (!doc.addEventListener) return;
26    window.addEventListener(resizeEvt, recalc, false);
27    doc.addEventListener('DOMContentLoaded', recalc, false);
28  } else {
29    resizeBaseFontSize();
30    window.addEventListener('resize', resizeBaseFontSize, false);
31    window.addEventListener('orientationchange', resizeBaseFontSize, false);
32  }
33
34  function resizeBaseFontSize() {
35    if ( deviceWidth > 1260) {
36      deviceWidth = rootHtml.clientWidth
37    } else {
38      deviceWidth = 1600;
39    }
40    rootHtml.style.fontSize = deviceWidth / 11 + 'px';
41  }
42
43
44  function PhoneResize() {
45    /* 添加倍屏标识,安卓为1 */
46    docEl.setAttribute('data-dpr', window.navigator.appVersion.match(/iphone/gi) ? window.devicePixelRatio : 1);
47
48    if (/iP(hone|od|ad)/.test(window.navigator.userAgent)) {
49      /* 添加IOS标识 */
50      doc.documentElement.classList.add('ios');
51      /* IOS8以上给html添加hairline样式,以便特殊处理 */
52      if (parseInt(window.navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/)[1], 10) >= 8)
53        doc.documentElement.classList.add('hairline');
54    }
55  }
56}(window);
57
58
59var screenWidth = window.innerWidth;
60var UI_SIZE_M = 375 // 设计图宽度
61function converSize(baseNum = 12) {
62  return (document.body.offsetWidth / UI_SIZE_M) * baseNum;
63}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.