Last active
April 3, 2017 18:26
-
-
Save ScalableJS/00a02d6628ad81a9e2298c0d18b8de26 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function presetCss(){ | |
var preloadImages = function (context) { | |
var arrImg = context.match(/service.maxymiser.net\/cm\/images-[^\/]+([^)'"\\]+)/g) || []; | |
for (var i = 0; i < arrImg.length; i++) { | |
new Image().src = "//" + arrImg[i]; | |
} | |
}; | |
var campaignStyles = campaign.getStyles().join(' '); | |
if(campaignStyles) { | |
preloadImages(campaignStyles); | |
dom.addCss(campaignStyles) | |
} | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment