Using this SDK requires that the website allow Iframe embedding
1 Code Display
Copy the following code into the html script tag
(function () {
var moyin = document.createElement('script');
moyin.src = 'https://webfiles.moyincloud.com/hc/sdk/moyin-1.0.0.min.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(moyin, s);
})();
2
3
4
5
6
Used in functions that call pop-ups
const {useDocIframe, useVideoIframe} = window.MoYinSDK
// 调用帮助文档弹窗
useDocIframe('https://xxxxx', {
dialogModal: {
background: 'rgb(0, 0, 0, 0.6)',
},
dialog: {
maxWidth: '1200px',
top: '10vh',
right: '10vw',
background: '#fff',
}
})
// 调用视频弹窗
useVideoIframe('https://xxxx', {
phoneMatchMediaWidth: 900,
dialogModal: {
phoneBg: '#000',
defaultBg: ''
},
dialog: {
width: '80vw',
maxWidth: '1200px',
paddingTop: '56.25%'
}
})
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
2 Parameter Description
useDocIframe parameter
Stats |
Instructions |
type |
Default value |
---|---|---|---|
url |
The url path to the help document |
string |
' ' |
params |
Popup style property |
object |
{} |
Set Params parameters
Stats |
Instructions |
type |
Default value |
---|---|---|---|
dialogModal |
modal layer style property |
object |
{} |
dialog |
Pops the style properties of the window layer |
object |
{} |
Configuring dialogModal parameters
Stats |
Instructions |
type |
Default value |
---|---|---|---|
background |
backdrop |
string |
' ' |
dialog parameter configuration
dialog set to position: fixed;
Stats |
Instructions |
type |
Default value |
---|---|---|---|
top |
The distance of the popup from the top of the page |
string |
'unset' |
bottom |
The distance of the popup from the bottom of the page |
string |
'unset' |
left |
The distance of the popup to the left of the page |
string |
'unset' |
right |
The distance from the popup to the right of the page |
string |
'unset' |
width |
Popup width |
string |
'500px' |
height |
Popup height |
string |
'450px' |
background |
Popup background |
string |
'#ffffff' |
border |
Pop-up border style |
string |
'1px solid #EDEFF2' |
borderRadius |
Pop-up window rounded corners |
string |
'6px' |
useVideoIframe parameter
Stats |
Instructions |
type |
Default value |
---|---|---|---|
url |
The url path to the help document |
string |
' ' |
params |
Popup style property |
object |
{} |
Set Params parameters
Stats |
Instructions |
type |
Default value |
---|---|---|---|
phoneMatchMediaWidth |
Phone size maximum width |
number |
900 |
dialogModal |
modal layer style property |
object |
{} |
dialog |
Pops the style properties of the window layer |
object |
{} |
Configuring dialogModal parameters
Stats |
Instructions |
type |
Default value |
---|---|---|---|
phoneBg |
Cell phone size background |
string |
' ' |
defaultBg |
web page size under the background |
string |
dialog parameter configuration
Stats |
Instructions |
type |
Default value |
---|---|---|---|
margin |
Bounce the window margin |
string |
'auto' |
width |
Popup width |
string |
'80vw' |
maxWidth |
Maximum popup width |
string |
'1200px' |
paddingTop |
Control the height of the popup, pass the percentage string, and the denominator is the width |
string (percent) |
'56.25%' |
