This commit is contained in:
Wei Zhu 2018-01-05 15:57:40 +08:00
parent 0125ae075f
commit aadff2d569

View File

@ -22,11 +22,12 @@ export default function svgBgToParallax(children, i = 0) {
return svgChildren;
}
//
const div = document.createElement('div');
div.style.display = 'none';
document.body.appendChild(div);
[
if (typeof window !== 'undefined') {
//
const div = document.createElement('div');
div.style.display = 'none';
document.body.appendChild(div);
[
'https://gw.alipayobjects.com/zos/rmsportal/DJWUmdpxcQakQHwhPjzf.png',
'https://gw.alipayobjects.com/zos/rmsportal/DEaRdiYbAyVNRelJpwXx.png',
'https://gw.alipayobjects.com/zos/rmsportal/cCmuVrmQIJYlrhFjiPDZ.png',
@ -49,8 +50,9 @@ document.body.appendChild(div);
'https://gw.alipayobjects.com/zos/rmsportal/qggKjIGNFlVmMpwDUXPU.svg',
'https://gw.alipayobjects.com/zos/rmsportal/dgjVqwkJvptQEtlfctvk.svg',
'https://gw.alipayobjects.com/zos/rmsportal/vUxYuDdsbBBcMDxSGmwc.svg',
].forEach((src) => {
].forEach((src) => {
const img = new Image();
img.src = src;
div.appendChild(img);
});
});
}