MCPcopy Create free account
hub / github.com/dcloudio/mui / createIframe

Function createIframe

js/mui.init.js:80–100  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

78 }
79 });
80 var createIframe = function(options) {
81 var wrapper = document.createElement('div');
82 wrapper.className = $.className('iframe-wrapper');
83 var styles = options.styles || {};
84 if (typeof styles.top !== 'string') {
85 styles.top = '0px';
86 }
87 if (typeof styles.bottom !== 'string') {
88 styles.bottom = '0px';
89 }
90 wrapper.style.top = styles.top;
91 wrapper.style.bottom = styles.bottom;
92 var iframe = document.createElement('iframe');
93 iframe.src = options.url;
94 iframe.id = options.id || options.url;
95 iframe.name = iframe.id;
96 wrapper.appendChild(iframe);
97 document.body.appendChild(wrapper);
98 //目前仅处理微信
99 $.os.wechat && handleScroll(wrapper, iframe);
100 };
101
102 function handleScroll(wrapper, iframe) {
103 var key = 'MUI_SCROLL_POSITION_' + document.location.href + '_' + iframe.src;

Callers 1

mui.init.jsFile · 0.70

Calls 1

handleScrollFunction · 0.70

Tested by

no test coverage detected