Здравствуйте, возникает ошибка в Uncaught TypeError: Cannot read property 'shouldStopExecution' of undefined. Как ее решить?
Вот сам код:
function Parallax2(options) {
options = options || {};
this.nameSpaces = {
wrapper: options.wrapper || '.parallax',
layers: options.layers || '.parallax-layer',
deep: options.deep || 'data-parallax-deep' };
this.init = function () {
var self = this,
parallaxWrappers = document.querySelectorAll(this.nameSpaces.wrapper);
for (var i = 0; i < parallaxWrappers.length; i++) {if (window.CP.shouldStopExecution(0)) break;
(function (i) {
parallaxWrappers[i].addEventListener('mousemove', function (e) {
var x = e.clientX,
y = e.clientY,
layers = parallaxWrappers[i].querySelectorAll(self.nameSpaces.layers);
for (var j = 0; j < layers.length; j++) {if (window.CP.shouldStopExecution(1)) break;
(function (j) {
var deep = layers[j].getAttribute(self.nameSpaces.deep),
disallow = layers[j].getAttribute('data-parallax-disallow'),
itemX = disallow && disallow === 'x' ? 0 : x / deep,
itemY = disallow && disallow === 'y' ? 0 : y / deep;
if (disallow && disallow === 'both') return;
layers[j].style.transform = 'translateX(' + itemX + '%) translateY(' + itemY + '%)';
})(j);
}window.CP.exitedLoop(1);
});
})(i);
}window.CP.exitedLoop(0);
};
this.init();
return this;
}
window.addEventListener('load', function () {
new Parallax2();
});
В чем может быть проблема?