How to remove loading effect in particle slider? - javascript

There is a loading effect which I want to remove from the below given Interactive particle logo.
The attempted code and codepen URL are as follows.
https://codepen.io/Zaku/pen/EDaunCodepent Interactive Particle Logo
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>ParticleSlider</title>
</head>
<body id="particle-slider">
<div class="slides">
<div id="first-slide" class="slide" data-src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAyAAAAGQCAMAAABh+/QGAAAC9FBMVEXu7u7u7u7////5+fn////u7u78/Pz7+/v////////////5+fn////////////7+/v////////////39/f////6+vr+/v76+vr////////39/f////v7+/9/f3v7+/////////+/v74+Pj////////////////////8/Pz5+fn////////////w8PD+/v7z8/P////7+/v////////9/f3u7u7////////4+Pj////////////////////////////////////u7u7////6+vr////09PT////////////////////////////////4+Pj////////y8vL////////////////////////v7+/////////////09PTu7u79/f3////////39/f////////////////////////////////////////////8/Pz////29vb////////z8/P////////////////x8fH////////////////////////z8/P////z8/P////////////////////////////////////19fX////v7+/x8fH////////////////////39/f////////w8PD////////x8fHz8/P////////////z8/P19fX////19fX////////////y8vL////29vb////x8fH////29vb////////////////////////////////v7+/////////////////x8fH////////19fX19fX////////x8fHw8PD09PT29vb////////w8PD////////y8vLw8PDw8PDy8vL09PTv7+/////////////////////////////////////////////////////////////////4+Pj////v7+/////y8vL///////////////8AAADu7u7u7u7v7+/y8vL19fXz8/P29vb5+fn4+Pj09PT39/f6+vr9/f37+/v8/Pz+/v7v7+////8Ohw90AAAA6nRSTlP+/VG3EfiorVyeTbVdYkysPhdSvl+yobNjU8Fg9qf3NWGjuzuEG0kSq7YfHVjuotZtrpwypftBIryRXlcWnXaNm5P5g7CQ0RpkixNFlHs9vXpW3UoUfk98dPRONn3Q/Kaaj8JlhkMZQGqKSDMuDKpQxnFm1xCgZ4zmhSZUKzgo1HLYmWsciG5sMBhoyUfy5440cHOJwJdb62+S4dOCeTrZy5XIloGY2yPHf+MnwzcsP0RCIC1p8yl1OTziJDHMzRVG5OjOxQ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+EPFARJorlbVDzAeiFogk91mOSPAJ84HoBSKyqdJqPnoFiGIgNiNyjflAZAMROb9X5fQB84EoByLJf4ZyzMfbzAeiHcitEWE+QCDZJS8PK4OrR5kPEMgt57uV5jTzAQK5PSLMBwjEdkS+YT5AIJP0Pz+cmY8dzAcI5G7fd0/Mx7cCEIimf2Pl0HDdTOYDBAIQCEAggJ8IBCAQgEAAAgEIBPAEgQAEAhAIQCAAgQCeIBCAQAACAQgEIBDAEwQCEAhAIACBAAQCeIJAAAIBCAQgEIBAAE8QCEAgAIEABAIQCOAJAgEIBCAQgEAAAgE8QSAAgQAEAhAIQCCAJwjkX/bpWAAAAABgkL/1NHaUQyAICAKCgCAwIQgIAoKAICAITAgCgoAgIAgIAhOCgCAgCAgCgsCEICAICAKCgCAwIQgIAoKAICAITAgCgoAgIAgIAhOCgCAgCAgCgsCEICAICAKCgCAwIQgIAoKAICAITAgCgoAgIAgIAhOCgCAgCAgCgsCEICAICAKCgCAwIQgIAoKAICAITAgCgoAgIAgIAhOCgCBQ+3RMAwAAwDDIv+u5WHqABwQBQUAQiBAEBAFBQBAQBCIEAUFAEBAEBIEIQUAQEAQEgacB7rniTaf7XcMAAAAASUVORK5CYII=">
</div>
</div>
<canvas class="draw"></canvas>
</body>
</html>
Script
var init = function(){
var isMobile = navigator.userAgent &&
navigator.userAgent.toLowerCase().indexOf('mobile') >= 0;
var isSmall = window.innerWidth < 1000;
var ps = new ParticleSlider({
ptlGap: isMobile || isSmall ? 3 : 0,
ptlSize: isMobile || isSmall ? 3 : 1,
width: 1e9,
height: 1e9
});
var gui = new dat.GUI();
gui.add(ps, 'ptlGap').min(0).max(5).step(1).onChange(function(){
ps.init(true);
});
gui.add(ps, 'ptlSize').min(1).max(5).step(1).onChange(function(){
ps.init(true);
});
gui.add(ps, 'restless');
gui.addColor(ps, 'color').onChange(function(value){
ps.monochrome = true;
ps.setColor(value);
ps.init(true);
});
(window.addEventListener
? window.addEventListener('click', function(){ps.init(true)}, false)
: window.onclick = function(){ps.init(true)});
}
var initParticleSlider = function(){
var psScript = document.createElement('script');
(psScript.addEventListener
? psScript.addEventListener('load', init, false)
: psScript.onload = init);
psScript.src = 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/23500/ps-0.9.js';
psScript.setAttribute('type', 'text/javascript');
document.body.appendChild(psScript);
}
(window.addEventListener
? window.addEventListener('load', initParticleSlider, false)
: window.onload = initParticleSlider);
I wanted to make a logo exactly like this but without loading effect on page load.

function ParticleSlider(a) {
var b = this;
b.sliderId = "particle-slider", b.color = "#fff", b.hoverColor = "#88f", b.width = 0, b.height = 20, b.ptlGap = 0, b.ptlSize = 1, b.slideDelay = 10, b.arrowPadding = 10, b.showArrowControls = !0, b.onNextSlide = null, b.onWidthChange = null, b.onHeightChange = null, b.onSizeChange = null, b.monochrome = !1, b.mouseForce = 1e4, b.restless = !0, b.imgs = [];
if (a) {
var c = ["color", "hoverColor", "width", "height", "ptlGap", "ptlSize", "slideDelay", "arrowPadding", "sliderId", "showArrowControls", "onNextSlide", "monochrome", "mouseForce", "restless", "imgs", "onSizeChange", "onWidthChange", "onHeightChange"];
for (var d = 0, e = c.length; d < e; d++) a[c[d]] && (b[c[d]] = a[c[d]])
}
b.$container = b.$("#" + b.sliderId), b.$$children = b.$container.childNodes, b.$controlsContainer = b.$(".controls"), b.$$slides = b.$(".slide", b.$(".slides").childNodes, !0), b.$controlLeft = null, b.$controlRight = null, b.$canv = b.$(".draw"), b.$srcCanv = document.createElement("canvas"), b.$srcCanv.style.display = "none", b.$container.appendChild(b.$srcCanv), b.$prevCanv = document.createElement("canvas"), b.$prevCanv.style.display = "none", b.$container.appendChild(b.$prevCanv), b.$nextCanv = document.createElement("canvas"), b.$nextCanv.style.display = "none", b.$container.appendChild(b.$nextCanv), b.$overlay = document.createElement("p"), b.$container.appendChild(b.$overlay), b.imgControlPrev = null, b.imgControlNext = null, b.$$slides.length <= 1 && (b.showArrowControls = !1), b.$controlsContainer && b.$controlsContainer.childNodes && b.showArrowControls == !0 ? (b.$controlLeft = b.$(".left", b.$controlsContainer.childNodes), b.$controlRight = b.$(".right", b.$controlsContainer.childNodes), b.imgControlPrev = new Image, b.imgControlNext = new Image, b.imgControlPrev.onload = function () {
b.$prevCanv.height = this.height, b.$prevCanv.width = this.width, b.loadingStep()
},
b.imgControlNext.onload = function () {
b.$nextCanv.height = this.height, b.$nextCanv.width = this.width, b.loadingStep()
},
b.imgControlPrev.src = b.$controlLeft.getAttribute("data-src"), b.imgControlNext.src = b.$controlRight.getAttribute("data-src")) : b.showArrowControls = !1, b.width <= 0 && (b.width = b.$container.clientWidth), b.height <= 0 && (b.height = b.$container.clientHeight), b.mouseDownRegion = 0, b.colorArr = b.parseColor(b.color), b.hoverColorArr = b.parseColor(b.hoverColor), b.mx = -1, b.my = -1, b.swipeOffset = 0, b.cw = b.getCw(), b.ch = b.getCh(), b.frame = 0, b.nextSlideTimer = !1, b.currImg = 0, b.lastImg = 0, b.imagesLoaded = 0, b.pxlBuffer = {
first: null
},
b.recycleBuffer = {
first: null
}, b.ctx = b.$canv.getContext("2d"), b.srcCtx = b.$srcCanv.getContext("2d"), b.prevCtx = b.$prevCanv.getContext("2d"), b.nextCtx = b.$nextCanv.getContext("2d"), b.$canv.width = b.cw, b.$canv.height = b.ch, b.shuffle = function () {
var a, b;
for (var c = 0, d = this.length; c < d; c++) b = Math.floor(Math.random() * d), a = this[c], this[c] = this[b], this[b] = a
}, Array.prototype.shuffle = b.shuffle, b.$canv.onmouseout = function () {
b.mx = -1, b.my = -1, b.mouseDownRegion = 0
}, b.$canv.onmousemove = function (a) {
function c(a) {
var c = 0,
d = 0,
e = typeof a == "string" ? b.$(a) : a;
if (e) {
c = e.offsetLeft, d = e.offsetTop;
var f = document.getElementsByTagName("body")[0];
while (e.offsetParent && e != f) c += e.offsetParent.offsetLeft, d += e.offsetParent.offsetTop, e = e.offsetParent
}
this.x = c, this.y = d
}
var d = new c(b.$container);
b.mx = a.clientX - d.x + document.body.scrollLeft + document.documentElement.scrollLeft, b.my = a.clientY - d.y + document.body.scrollTop + document.documentElement.scrollTop
}, b.$canv.onmousedown = function () {
if (b.imgs.length > 1) {
var a = 0;
b.mx >= 0 && b.mx < b.arrowPadding * 2 + b.$prevCanv.width ? a = -1 : b.mx > 0 && b.mx > b.cw - (b.arrowPadding * 2 + b.$nextCanv.width) && (a = 1), b.mouseDownRegion = a
}
}, b.$canv.onmouseup = function () {
if (b.imgs.length > 1) {
var a = "";
b.mx >= 0 && b.mx < b.arrowPadding * 2 + b.$prevCanv.width ? a = -1 : b.mx > 0 && b.mx > b.cw - (b.arrowPadding * 2 + b.$nextCanv.width) && (a = 1), a != 0 && b.mouseDownRegion != 0 && (a != b.mouseDownRegion && (a *= -1), b.nextSlideTimer && clearTimeout(b.nextSlideTimer), b.nextSlide(a)), b.mouseDownRegion = 0
}
};
if (b.imgs.length == 0)
for (var d = 0, e = b.$$slides.length; d < e; d++) {
var f = new Image;
b.imgs.push(f), f.src = b.$$slides[d].getAttribute("data-src")
}
b.imgs.length > 0 && (b.imgs[0].onload = function () {
b.loadingStep()
}), b.requestAnimationFrame(function () {
b.nextFrame()
})
}
var psParticle = function (a) {
this.ps = a, this.ttl = null, this.color = a.colorArr, this.next = null, this.prev = null, this.gravityX = 0, this.gravityY = 0, this.x = 0, this.y = 0, this.velocityX = 0, this.velocityY = 0
};
psParticle.prototype.move = function () {
var a = this.ps,
b = this;
if (this.ttl != null && this.ttl-- <= 0) a.swapList(b, a.pxlBuffer, a.recycleBuffer), this.ttl = null;
else {
var c = this.gravityX + a.swipeOffset - this.x,
d = this.gravityY - this.y,
e = Math.sqrt(Math.pow(c, 2) + Math.pow(d, 2)),
f = Math.atan2(d, c),
g = e * .01;
a.restless == !0 ? g = 0 : (this.x = this.gravityX - 60, this.y = this.gravityY);
var h = 0,
i = 0;
if (a.mx >= 0 && a.mouseForce) {
var j = this.x - a.mx,
k = this.y - a.my;
h = Math.min(a.mouseForce / (Math.pow(j, 2) + Math.pow(k, 2)), a.mouseForce), i = Math.atan2(k, j), typeof this.color == "function" && (i += Math.PI, h *= .001 + Math.random() * .1 - .05)
} else h = 0, i = 0;
this.velocityX += g * Math.cos(f) + h * Math.cos(i), this.velocityY += g * Math.sin(f) + h * Math.sin(i), this.velocityX *= .92, this.velocityY *= .92, this.x += this.velocityX, this.y += this.velocityY
}
}, ParticleSlider.prototype.Particle = psParticle, ParticleSlider.prototype.swapList = function (a, b, c) {
var d = this;
a == null ? a = new d.Particle(d) : b.first == a ? a.next != null ? (a.next.prev = null, b.first = a.next) : b.first = null : a.next == null ? a.prev.next = null : (a.prev.next = a.next, a.next.prev = a.prev), c.first == null ? (c.first = a, a.prev = null, a.next = null) : (a.next = c.first, c.first.prev = a, c.first = a, a.prev = null)
}, ParticleSlider.prototype.parseColor = function (a) {
var b, a = a.replace(" ", "");
if (b = /^#([\da-fA-F]{2})([\da-fA-F]{2})([\da-fA-F]{2})/.exec(a)) b = [parseInt(b[1], 16), parseInt(b[2], 16), parseInt(b[3], 16)];
else if (b = /^#([\da-fA-F])([\da-fA-F])([\da-fA-F])/.exec(a)) b = [parseInt(b[1], 16) * 17, parseInt(b[2], 16) * 17, parseInt(b[3], 16) * 17];
else if (b = /^rgba\(([\d]+),([\d]+),([\d]+),([\d]+|[\d]*.[\d]+)\)/.exec(a)) b = [+b[1], +b[2], +b[3], +b[4]];
else if (b = /^rgb\(([\d]+),([\d]+),([\d]+)\)/.exec(a)) b = [+b[1], +b[2], +b[3]];
else return null;
isNaN(b[3]) && (b[3] = 1), b[3] *= 255;
return b
}, ParticleSlider.prototype.loadingStep = function () {
var a = this;
a.imagesLoaded++;
if (a.imagesLoaded >= 3 || a.showArrowControls == !1) a.resize(), a.slideDelay > 0 && (a.nextSlideTimer = setTimeout(function () {
a.nextSlide()
}, 1e3 * a.slideDelay))
}, ParticleSlider.prototype.$ = function (a, b, c) {
var d = this;
if (a[0] == ".") {
var e = a.substr(1);
b || (b = d.$$children);
var f = [];
for (var g = 0, h = b.length; g < h; g++) b[g].className && b[g].className == e && f.push(b[g]);
return f.length == 0 ? null : f.length == 1 && !c ? f[0] : f
}
return document.getElementById(a.substr(1))
}, ParticleSlider.prototype.nextFrame = function () {
var a = this;
a.mouseDownRegion == 1 && a.mx < a.cw / 2 || a.mouseDownRegion == -1 && a.mx > a.cw / 2 ? a.swipeOffset = a.mx - a.cw / 2 : a.swipeOffset = 0;
var b = a.pxlBuffer.first,
c = null;
while (b != null) c = b.next, b.move(), b = c;
a.drawParticles();
if (a.frame++ % 25 == 0 && (a.cw != a.getCw() || a.ch != a.getCh())) {
var d = a.getCh(),
e = a.getCw();
a.ch != e && typeof a.onWidthChange == "function" && a.onWidthChange(a, e), a.ch != d && typeof a.onHeightChange == "function" && a.onHeightChange(a, d), typeof a.onSizeChange == "function" && a.onSizeChange(a, e, d), a.resize()
}
setTimeout(function () {
a.requestAnimationFrame(function () {
a.nextFrame()
})
}, 15)
}, ParticleSlider.prototype.nextSlide = function (a) {
var b = this;
b.nextSlideTimer != null && b.imgs.length > 1 ? (b.currImg = (b.currImg + b.imgs.length + (a ? a : 1)) % b.imgs.length, b.resize(), b.slideDelay > 0 && (b.nextSlideTimer = setTimeout(function () {
b.nextSlide()
}, 1e3 * b.slideDelay))) : b.slideDelay > 0 && (b.nextSlideTimer = setTimeout(function () {
b.nextSlide()
}, 1e3 * b.slideDelay)), typeof b.onNextSlide == "function" && b.onNextSlide(b.currImg)
}, ParticleSlider.prototype.drawParticles = function () {
var a = this,
b = a.ctx.createImageData(a.cw, a.ch),
c = b.data,
d, e, f, g, h, i, j = a.pxlBuffer.first;
while (j != null) {
e = ~~j.x, f = ~~j.y;
for (g = e; g < e + a.ptlSize && g >= 0 && g < a.cw; g++)
for (h = f; h < f + a.ptlSize && h >= 0 && h < a.ch; h++) d = (h * b.width + g) * 4, i = typeof j.color == "function" ? j.color() : j.color, c[d + 0] = i[0], c[d + 1] = i[1], c[d + 2] = i[2], c[d + 3] = i[3];
j = j.next
}
b.data = c, a.ctx.putImageData(b, 0, 0)
}, ParticleSlider.prototype.getPixelFromImageData = function (a, b, c) {
var d = this,
e = [];
for (var f = 0; f < a.width; f += d.ptlGap + 1)
for (var g = 0; g < a.height; g += d.ptlGap + 1) i = (g * a.width + f) * 4, a.data[i + 3] > 0 && e.push({
x: b + f,
y: c + g,
color: d.monochrome == !0 ? [d.colorArr[0], d.colorArr[1], d.colorArr[2], d.colorArr[3]] : [a.data[i], a.data[i + 1], a.data[i + 2], a.data[i + 3]]
});
return e
}, ParticleSlider.prototype.init = function (a) {
var b = this;
if (b.imgs.length > 0) {
b.$srcCanv.width = b.imgs[b.currImg].width, b.$srcCanv.height = b.imgs[b.currImg].height, b.srcCtx.clearRect(0, 0, b.$srcCanv.width, b.$srcCanv.height), b.srcCtx.drawImage(b.imgs[b.currImg], 0, 0);
var c = b.getPixelFromImageData(b.srcCtx.getImageData(0, 0, b.$srcCanv.width, b.$srcCanv.height), ~~(b.cw / 2 - b.$srcCanv.width / 2), ~~(b.ch / 2 - b.$srcCanv.height / 2));
if (b.showArrowControls == !0) {
b.prevCtx.clearRect(0, 0, b.$prevCanv.width, b.$prevCanv.height), b.prevCtx.drawImage(b.imgControlPrev, 0, 0);
var d = b.getPixelFromImageData(b.prevCtx.getImageData(0, 0, b.$prevCanv.width, b.$prevCanv.height), b.arrowPadding, ~~(b.ch / 2 - b.$prevCanv.height / 2));
for (var e = 0, f = d.length; e < f; e++) d[e].color = function () {
return b.mx >= 0 && b.mx < b.arrowPadding * 2 + b.$prevCanv.width ? b.hoverColorArr : b.colorArr
}, c.push(d[e]);
b.nextCtx.clearRect(0, 0, b.$nextCanv.width, b.$nextCanv.height), b.nextCtx.drawImage(b.imgControlNext, 0, 0);
var g = b.getPixelFromImageData(b.nextCtx.getImageData(0, 0, b.$nextCanv.width, b.$nextCanv.height), b.cw - b.arrowPadding - b.$nextCanv.width, ~~(b.ch / 2 - b.$nextCanv.height / 2));
for (var e = 0, f = g.length; e < f; e++) g[e].color = function () {
return b.mx > 0 && b.mx > b.cw - (b.arrowPadding * 2 + b.$nextCanv.width) ? b.hoverColorArr : b.colorArr
}, c.push(g[e])
}
if (b.currImg != b.lastImg || a == !0) c.shuffle(), b.lastImg = b.currImg;
var h = b.pxlBuffer.first;
for (var e = 0, f = c.length; e < f; e++) {
var i = null;
h != null ? (i = h, h = h.next) : (b.swapList(b.recycleBuffer.first, b.recycleBuffer, b.pxlBuffer), i = b.pxlBuffer.first), i.gravityX = c[e].x, i.gravityY = c[e].y, i.color = c[e].color
}
while (h != null) h.ttl = ~~(Math.random() * 10), h.gravityY = ~~(b.ch * Math.random()), h.gravityX = ~~(b.cw * Math.random()), h = h.next;
b.$overlay.innerHTML = b.$$slides[b.currImg].innerHTML
}
}, ParticleSlider.prototype.getCw = function () {
var a = this;
return Math.min(document.body.clientWidth, a.width, a.$container.clientWidth)
}, ParticleSlider.prototype.getCh = function () {
var a = this;
return Math.min(document.body.clientHeight, a.height, a.$container.clientHeight)
}, ParticleSlider.prototype.resize = function () {
var a = this;
a.cw = a.getCw(), a.ch = a.getCh(), a.$canv.width = a.cw, a.$canv.height = a.ch, a.init(!0)
}, ParticleSlider.prototype.setColor = function (a) {
var b = this;
b.colorArr = b.parseColor(a)
}, ParticleSlider.prototype.setHoverColor = function (a) {
var b = this;
b.hoverColorArr = b.parseColor(a)
}, ParticleSlider.prototype.requestAnimationFrame = function (a) {
var b = this,
c = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function (a) {
window.setTimeout(a, 1e3 / 60)
};
c(a)
};
I had updated the particle.js file to remove loading animation.try this..

Related

Replace img with lazyload

I'm using lazyload plugin on my page and it has data-src parameter and at the same time I'm using another plugin to replace my image on responsive and it's using data-src parameter too.and I change name of data-src as data-swapMeto not conflict. but I wonder that lazyload notice my image or not ? which one is work lazy ? replace img ? or both ?
and another thing is there any way to remove data-src-base my path can be different
click to see my project on codepen
function makeImagesResponsive() {
var e = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth,
t = document.getElementsByTagName("body")[0].getElementsByTagName("img");
if (t.length === 0) return;
var n;
t[0].hasAttribute ? n = function(e, t) {
return e.hasAttribute(t)
} : n = function(e, t) {
return e.getAttribute(t) !== null
};
var r = window.devicePixelRatio ? window.devicePixelRatio >= 1.2 ? 1 : 0 : 0;
for (var i = 0; i < t.length; i++) {
var s = t[i],
o = r && n(s, "data-swapMe2x") ? "data-swapMe2x" : "data-swapMe",
u = r && n(s, "data-src-base2x") ? "data-src-base2x" : "data-src-base";
if (!n(s, o)) continue;
var a = n(s, u) ? s.getAttribute(u) : "",
f = s.getAttribute(o),
l = f.split(",");
for (var c = 0; c < l.length; c++) {
var h = l[c].split(":"),
p = h[0],
d = h[1],
v, m;
if (p.indexOf("<") !== -1) {
v = p.split("<");
if (l[c - 1]) {
var g = l[c - 1].split(/:(.+)/),
y = g[0].split("<");
m = e <= v[1] && e > y[1]
} else m = e <= v[1]
} else {
v = p.split(">");
if (l[c + 1]) {
var b = l[c + 1].split(/:(.+)/),
w = b[0].split(">");
m = e >= v[1] && e < w[1]
} else m = e >= v[1]
}
if (m) {
var E = a + d;
s.src !== E && s.setAttribute("src", E);
break
}
}
}
}
if (window.addEventListener) {
window.addEventListener("load", makeImagesResponsive, !1);
window.addEventListener("resize", makeImagesResponsive, !1)
} else {
window.attachEvent("onload", makeImagesResponsive);
window.attachEvent("onresize", makeImagesResponsive)
};
<html lang="en">
<head>
<meta charset="UTF-8" />
</head>
<body>
<aside>
<img alt='kitten!' data-src-base='http://yurtici.anitur.com.tr/musteri/ingoing/2017/htm/img/' data-src="http://yurtici.anitur.com.tr/musteri/ingoing/2017/htm/img/1.jpg" data-swapMe='<480:4.jpg,<768:3.jpg,<960:2.jpg,>960:1.jpg' class="lazyload" />
</aside>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lazysizes/2.0.7/lazysizes.min.js"></script>
</body>
</html>

How to do vertical infinite repeating background for a JavaScript game?

I have been looking at the code of this Flappy Bird clone to figure out how to repeat a background image vertically but have had no luck so far.
http://www.codeproject.com/Articles/778727/Build-Flappy-Bird-with-jQuery-and-lines-of-Javascr
I've altered the code so far to be able to scroll down, but the repetition of the bg image stops after around 800pixels of moving down and for the hell of me I cant figure out why!
I have heard that this code is not the best code out there, so if someone has another way to do this I'm all ears.
This is the codepen to preview the nonworking background:
http://codepen.io/tangwei/pen/dpbQPZ
var bird = null, board = null;
var dimPipe = { width:40, height:420 }, cPos = { x: 80, y:100, h:40, w:50 };
var gravity = 0.5, iniSpeed = -7, curSpeed = 0;
var score = 0, noClr = 0, tmStep = 0, state = 0; // 0-not started,1-play,2-over;
(function($) {
$.cssNumber.rotate = true;
$.cssHooks.rotate = {
set : function(el, v) {
if (typeof v === 'string')
v = (v.indexOf("rad") != -1) ? parseInt(v) * 180 / Math.PI : parseInt(v);
v = (~~v);
if (v == ($.data(el, 'rotate') || 0)) return;
el.style["MozTransform"] = el.style["MozTransform"] = el.style["-webkit-transform"]
= el.style["transform"] = " rotate(" + (v % 360) + "deg)";
$.data(el, 'rotate', v);
},
get : function(el, computed) {
return $.data(el, 'rotate') || 0;
}
};
})(jQuery);
function gameOver() {
state = 2;
$(":animated").stop();
if (tmStep) tmStep = window.clearInterval(tmStep);
bird.animate({ top:board.height()-cPos.h, rotate:540}, 1000)
.animate({ top:board.height()-cPos.h}, 500, function() {
$('#score').text(' Score: ' + score);
start();
});
}
function Parallax(elm, tmo) {
elm.animate({top:-1000}, { // play around with this value to determine speed
duration:tmo*50, easing:'linear', //step : PrlxStep,
complete : function() { Parallax(elm, tmo); }
});
}
function BirdStep() {
curSpeed += gravity;
cPos.y = Math.max(cPos.y + curSpeed, 0);
var ang = curSpeed * 5, mh = board.height()-cPos.h, m = -12, lo = 0, actPipe = $('.obs');
bird.css({top: cPos.y, rotate:(ang < -20) ? -20 : (ang > 90) ? 90 : ang});
// if (cPos.y > mh)
// return gameOver();
// for (var i = actPipe.length-1; i >= 0; i--) {
// var s = actPipe[i].style, x = parseInt(s.left), y = parseInt(s.top);
// lo = Math.max(lo, x);
// if (x+dimPipe.width +m < cPos.x || x > cPos.x+cPos.w+m) continue;
// if (y+dimPipe.height+m < cPos.y || y > cPos.y+cPos.h+m) continue;
// return gameOver();
// }
// if (actPipe.length > 3 || lo > 300 || Math.random() >= 0.05 * (1+noClr))
// return;
// var og = cPos.h * 2;
// var oh = og + Math.floor(Math.random() * (mh-og+1));
// var obs = $("<img/><img/>").addClass('c obs').css({left:480, zIndex:3}).css(dimPipe).attr('src', 'vine.png')
// .appendTo(board).animate({left:-50}, Math.max(2000,3500-noClr*50), 'linear', function() {
// $('#score').text(' Score: ' + (score += 1 + Math.floor(++noClr/10)));
// this.remove();
// });
// obs[0].style.top = oh + 'px';
// obs[1].style.top = (oh - og - dimPipe.height) + "px";
}
function onTap() {
if (state > 1) return;
if (state == 0) {
state = 1;
$('#score').text(' Score: ' + (score = 0));
Parallax($('#bGrnd'), 40);
Parallax($('#fGrnd'), 80);
$('#instr').hide();
tmStep = window.setInterval(BirdStep, 30);
}
curSpeed = iniSpeed;
}
function start() {
state = noClr = score = 0; // not started
cPos = { x: 80, y:100, h:40, w:50 };
bird.css({left:cPos.x, top:cPos.y, width:cPos.w, height:cPos.h, rotate:0});
// $('.obs').remove();
$('#instr').show();
}
$(document).ready(function() {
bird = $('#bird');
var evt = (typeof(bird[0].ontouchend) == "function") ? "touchstart" : "mousedown";
board = $('#board').bind(evt, onTap);
start();
setInterval(function(){
var bGrnd = $("#bGrnd");
var curr_height = parseInt(bGrnd.css("height"));
curr_height += 1000;
bGrnd.css("height", curr_height);
},2000)
});

setSize in Phaser.io

I'm using the latest phaser.io version, but I'm getting a error which is probably related to these lines:
Phaser.Rectangle.contains(e.body, game.input.activePointer.x, game.input.activePointer.y);
and
shapesprite.body.setSize(30, 30, 0, 0);
I have commented out the line above, and it somewhat works, but then I get this error:
Game.js:195 Uncaught TypeError: Cannot read property 'setSize' of null
And I guess my sprite has 18 sections to read through.
Here is the sprite image. The left column is the unclicked state, and then right column is the clicked state
My code:
gameObj.Game = function (game) {
//step 1
var myTime;
var gameSeconds; //total game seconds
var timerSeconds = "0"; //current timer in seconds
var secondsLeft; //total game seconds - current timer second
var points;
var pointsShow;
};
var tile_size = 69;
gameObj.Game.prototype = {
create: function () {
var border = this.add.sprite(this.world.centerX, this.world.centerY, 'border');
border.anchor.setTo(0.5, 0.5);
var stroke = this.add.sprite(this.world.centerX + 30, this.world.centerX - 450, 'stroke');
points = 0;
gameObj.finalScore = points;
var currentTarg = this.add.sprite(this.world.centerX + 200, this.world.centerX - 125, 'currenttarget');
this.shapes = this.add.group();
this.shapes.createMultiple(36, 'shapesprite');
this.shapes.setAll('inputEnabled', true);
this.shapes.setAll('input.useHandCursor', true);
var progressbackground = this.add.sprite(this.world.centerX + 90, this.world.centerX - 380, 'progressbg');
var myPercentStyle = {
font: "400 24px Architects Daughter",
fill: "#000",
align: "center"
};
pointsShow = this.add.text(this.world.centerX + 195, this.world.centerX - 300, points + '%', myPercentStyle);
var myProgress = "Progress of \nShape Painting"
var myProgressStyle = {
font: "400 18px Architects Daughter",
fill: "#000",
align: "center"
};
var myProgressShow = this.add.text(this.world.centerX + 160, this.world.centerX - 360, myProgress, myProgressStyle);
var currentTargText = "Mix colors and make a:"
var currentTargStyle = {
font: "400 18px Architects Daughter",
fill: "#000",
align: "center"
};
var currentTargShow = this.add.text(this.world.centerX + 135, this.world.centerX - 220, currentTargText, currentTargStyle);
var targetBg = this.add.sprite(this.world.centerX + 140, this.world.centerX - 190, 'targetbg');
var timerbackground = this.add.sprite(this.world.centerX + 90, this.world.centerY + 120, 'timerbg');
var myTimeText = "Time until Art Show:";
var myTimeTextStyle = {
font: "400 24px Architects Daughter",
fill: "#000",
align: "center"
};
var myTimeShow = this.add.text(this.world.centerX + 110, this.world.centerX + 35, myTimeText, myTimeTextStyle);
var myTime = "2:00"
var myTimeStyle = {
font: "400 35px Architects Daughter",
fill: "#000",
align: "center"
};
myTimerShow = this.add.text(this.world.centerX + 190, this.world.centerX + 70, myTime, myTimeStyle);
tmpWinnerBtn = this.add.button(100, 200, 'btn_winner', this.winnerFun, this, 1, 0, 2);
tmpWinnerBtn.anchor.setTo(0.5, 0.5);
tmpLoserBtn = this.add.button(200, 200, 'btn_loser', this.loserFun, this, 1, 0, 2);
tmpLoserBtn.anchor.setTo(0.5, 0.5);
//timevars
tmpPointsBtn = this.add.button(300, 100, 'points_btn', this.pointsIncrease, this, 1, 0, 2);
gameSeconds = 120;
timerSeconds = 0;
secondsLeft = 0;
//create timer object
timerObj = this.game.time.create(false);
//set a timer event to occur every 1 second
timerObj.loop(1000, this.updateTimer, this);
//start the timer running
timerObj.start();
// this.combo_s = this.game.add.audio('combo');
this.clicked = false;
this.count = 0;
this.moves = 0;
this.type = -1;
this.deleted_shapes = [];
this.pos_i = -1;
this.pos_j = -1;
this.offset_x = 120;
this.offset_y = 150;
this.next_time = 0;
score = 0;
//this.width=69;
this.build_world();
},
update: function () {
this.shapes.forEachAlive(function (e) {
if (e.scale.x == 2) e.kill();
}, this);
if (game.input.activePointer.isDown && game.time.now > this.next_time) {
this.clicked = true;
this.try_select_a_shapesp();
}
if (game.input.activePointer.isUp && this.clicked) {
if (this.count > 1) {
this.remove_selected_shapes();
this.move_shapes_down();
this.add_missing_shapes();
} else
this.unselect_all_shapes();
//this.next_time = game.time.now + 300;
this.count = 0;
this.clicked = false;
this.type = -1;
this.pos_i = -1;
this.pos_j = -1;
}
},
build_world: function () {
for (var i = 0; i < 6; i++)
for (var j = 0; j < 6; j++)
this.add_shapesp(i, j, true);
},
add_shapesp: function (i, j, type) {
var shapesprite = this.shapes.getFirstExists(false);
var r = rand(3);
if (r == 1) shapesprite.frame = 2;
else if (r == 3) shapesprite.frame = 6;
else if (r == 2) shapesprite.frame = 4;
// else if (r == 2) shapesprite.frame = 4;
// else if (r == 3) shapesprite.frame = 6;
// else if (r == 4) shapesprite.frame = 8;
// else if (r == 5) shapesprite.frame = 10;
// // else if (r == 6) shapesprite.frame = 12;
// else if (r == 7) shapesprite.frame = 14;
// // else if (r == 8) shapesprite.frame = 16;
// else if (r == 9) shapesprite.frame = 18;
// // else if (r == 10) shapesprite.frame = 20;
// else if (r == 11) shapesprite.frame = 22;
// // else if (r == 12) shapesprite.frame = 24;
// else if (r == 13) shapesprite.frame = 26;
// else if (r == 14) shapesprite.frame = 28;
// // else if (r == 15) shapesprite.frame = 30;
// else if (r == 16) shapesprite.frame = 32;
// else if (r == 17) shapesprite.frame = 34;
// else if (r == 18) shapesprite.frame = 36;
shapesprite.anchor.setTo(0.5, 0.5);
shapesprite.selected = false;
shapesprite.pos_i = i;
shapesprite.pos_j = j;
shapesprite.move_y = 0;
shapesprite.move_x = 1;
shapesprite.body.setSize(30, 30, 0, 0);
shapesprite.alpha = 1;
shapesprite.scale.setTo(5, 1);
shapesprite.alive2 = true;
shapesprite.reset(this.offset_x + j * tile_size, this.offset_y + i * tile_size);
if (type)
this.game.add.tween(shapesprite.scale).delay(j * 100 + 1).to({
x: 1,
y: 1
}, 400).start();
else
this.game.add.tween(shapesprite.scale).delay(400).to({
x: 1,
y: 1
}, 400).start();
},
try_select_a_shapesp: function (e) {
this.shapes.forEachAlive(function (e) {
var bool = Phaser.Rectangle.contains(e.body, game.input.activePointer.x, game.input.activePointer.y);
if (e.selected || !bool) {
//console.log('hi');
return;
}
if (this.type == -1)
this.type = e.frame;
if (this.type == e.frame && this.in_range(e))
this.select_a_shapesp(e);
else
this.unselect_all_shapes();
}, this);
},
select_a_shapesp: function (e) {
e.selected = true;
e.frame += 1;
this.count += 1;
this.pos_j = e.pos_j;
this.pos_i = e.pos_i;
// this.increase_bar();
},
remove_selected_shapes: function (e) {
this.shapes.forEachAlive(function (e) {
if (!e.selected)
return;
this.game.add.tween(e.scale).to({
x: 2,
y: 2
}, 300).start();
this.game.add.tween(e).to({
alpha: 0
}, 300).start();
this.deleted_shapes.push({
i: e.pos_i,
j: e.pos_j
});
e.alive2 = false;
}, this);
},
unselect_all_shapes: function () {
this.count = 0;
this.shapes.forEachAlive(function (e) {
if (e.selected) {
e.selected = false;
e.frame -= 1;
}
}, this);
this.clear_bar();
},
move_shapes_down: function () {
for (var i = 0; i < this.deleted_shapes.length; i++) {
var tmp_i = this.deleted_shapes[i].i;
var tmp_j = this.deleted_shapes[i].j;
this.shapes.forEachAlive(function (e) {
if (!e.selected && e.pos_j == tmp_j && e.pos_i < tmp_i)
e.move_y += tile_size;
}, this);
}
this.shapes.forEachAlive(function (e) {
if (e.move_y == 0)
return;
var coef = e.move_y / tile_size;
e.pos_i += coef;
this.add.tween(e).delay(100).to({
y: e.y + e.move_y
}, 100 * coef).start();
e.move_y = 0;
}, this);
this.deleted_shapes = [];
},
add_missing_shapes: function () {
var min = [6, 6, 6, 6, 6, 6];
this.shapes.forEachAlive(function (e) {
if (e.pos_i < min[e.pos_j] && e.alive2)
min[e.pos_j] = e.pos_i;
}, this);
for (var i = 0; i < 6; i++)
for (var j = 0; j < min[i]; j++)
this.add_shapesp(j, i, false);
},
update_score_and_labels: function () {
this.clear_bar();
this.game.state.start('End');
},
in_range: function (d) {
if (this.pos_j == -1) return true;
return (this.pos_j - 1 == d.pos_j && this.pos_i == d.pos_i) ||
(this.pos_j + 1 == d.pos_j && this.pos_i == d.pos_i) ||
(this.pos_j == d.pos_j && this.pos_i - 1 == d.pos_i) ||
(this.pos_j == d.pos_j && this.pos_i + 1 == d.pos_i);
},
clear_bar: function () {
this.game.add.tween(this.progress).to({
}, 300).start();
},
add_tuto: function () {
this.tuto = this.game.add.button(0, 0, 'tuto', this.remove_tuto, this);
},
updateTimer: function () {
//console.log('hola');
timerSeconds++;
if (timerSeconds <= gameSeconds) {
secondsLeft = gameSeconds - timerSeconds;
//
displayMin = Math.floor(secondsLeft / 60) % 60;
displaySec = Math.floor(secondsLeft) % 60;
//
if (displayMin < 10) {
displayMin = "" + displayMin;
}
if (displaySec < 10) {
displaySec = "0" + displaySec;
}
myTimerShow.setText(displayMin + ":" + displaySec);
} else {
timerSeconds = 0;
this.loserFun();
}
},
pointsIncrease: function () {
//console.log("increase");
gameObj.finalScore += 10;
points = gameObj.finalScore;
pointsShow.setText(points + "%");
if (points == 100) {
this.game.state.start('Winner');
}
},
winnerFun: function () {
gameObj.finalTime = timerSeconds;
this.state.start('Winner');
},
loserFun: function () {
gameObj.finalTime = timerSeconds;
this.state.start('Loser');
}
};
No-where in your code do you enable physics on the shapesprites. They won't have a body you can access until you do this first:
Here's one way of doing it: http://phaser.io/examples/v2/arcade-physics/group-vs-self

How to read the blockadblock script?

I'm wondering how to decode the script, I'm trying to customize the design but its so hard to read the code
there script is here:
https://blockadblock.com/blockadblock_basic_script.php
It's just encrypted inline with a function, no "obfuscation with a key"
Run the function without the initial "eval" here: http://www.webtoolkitonline.com/javascript-tester.html
and you'll get the code:
Result = ;
var xcJQCflAmpis = '',
KkUCuxqIgh = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
for (var i = 0; i < 12; i++) xcJQCflAmpis += KkUCuxqIgh.charAt(Math.floor(Math.random() * KkUCuxqIgh.length));
var VABjXzYzJp = 8,
WSpSwDLzQd = 91,
nsJjjBITZC = 178,
neMuFFBFgq = 19,
rMwHazIJjv = function(t) {
var o = !1,
i = function() {
if (document.addEventListener) {
document.removeEventListener('DOMContentLoaded', e);
window.removeEventListener('load', e)
} else {
document.detachEvent('onreadystatechange', e);
window.detachEvent('onload', e)
}
},
e = function() {
if (!o && (document.addEventListener || event.type === 'load' || document.readyState === 'complete')) {
o = !0;
i();
t()
}
};
if (document.readyState === 'complete') {
t()
} else if (document.addEventListener) {
document.addEventListener('DOMContentLoaded', e);
window.addEventListener('load', e)
} else {
document.attachEvent('onreadystatechange', e);
window.attachEvent('onload', e);
var n = !1;
try {
n = window.frameElement == null && document.documentElement
} catch (r) {};
if (n && n.doScroll) {
(function a() {
if (o) return;
try {
n.doScroll('left')
} catch (e) {
return setTimeout(a, 50)
};
o = !0;
i();
t()
})()
}
}
};
window['' + xcJQCflAmpis + ''] = (function() {
var t = {
t$: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=',
encode: function(e) {
var d = '',
l, r, i, s, c, a, n, o = 0;
e = t.n$(e);
while (o < e.length) {
l = e.charCodeAt(o++);
r = e.charCodeAt(o++);
i = e.charCodeAt(o++);
s = l >> 2;
c = (l & 3) << 4 | r >> 4;
a = (r & 15) << 2 | i >> 6;
n = i & 63;
if (isNaN(r)) {
a = n = 64
} else if (isNaN(i)) {
n = 64
};
d = d + this.t$.charAt(s) + this.t$.charAt(c) + this.t$.charAt(a) + this.t$.charAt(n)
};
return d
},
decode: function(e) {
var n = '',
l, c, d, s, r, i, a, o = 0;
e = e.replace(/[^A-Za-z0-9\+\/\=]/g, '');
while (o < e.length) {
s = this.t$.indexOf(e.charAt(o++));
r = this.t$.indexOf(e.charAt(o++));
i = this.t$.indexOf(e.charAt(o++));
a = this.t$.indexOf(e.charAt(o++));
l = s << 2 | r >> 4;
c = (r & 15) << 4 | i >> 2;
d = (i & 3) << 6 | a;
n = n + String.fromCharCode(l);
if (i != 64) {
n = n + String.fromCharCode(c)
};
if (a != 64) {
n = n + String.fromCharCode(d)
}
};
n = t.e$(n);
return n
},
n$: function(t) {
t = t.replace(/;/g, ';');
var n = '';
for (var o = 0; o < t.length; o++) {
var e = t.charCodeAt(o);
if (e < 128) {
n += String.fromCharCode(e)
} else if (e > 127 && e < 2048) {
n += String.fromCharCode(e >> 6 | 192);
n += String.fromCharCode(e & 63 | 128)
} else {
n += String.fromCharCode(e >> 12 | 224);
n += String.fromCharCode(e >> 6 & 63 | 128);
n += String.fromCharCode(e & 63 | 128)
}
};
return n
},
e$: function(t) {
var o = '',
e = 0,
n = c1 = c2 = 0;
while (e < t.length) {
n = t.charCodeAt(e);
if (n < 128) {
o += String.fromCharCode(n);
e++
} else if (n > 191 && n < 224) {
c2 = t.charCodeAt(e + 1);
o += String.fromCharCode((n & 31) << 6 | c2 & 63);
e += 2
} else {
c2 = t.charCodeAt(e + 1);
c3 = t.charCodeAt(e + 2);
o += String.fromCharCode((n & 15) << 12 | (c2 & 63) << 6 | c3 & 63);
e += 3
}
};
return o
}
};
var a = ['YWQtbGVmdA==', 'YWRCYW5uZXJXcmFw', 'YWQtZnJhbWU=', 'YWQtaGVhZGVy', 'YWQtaW1n', 'YWQtaW5uZXI=', 'YWQtbGFiZWw=', 'YWQtbGI=', 'YWQtZm9vdGVy', 'YWQtY29udGFpbmVy', 'YWQtY29udGFpbmVyLTE=', 'YWQtY29udGFpbmVyLTI=', 'QWQzMDB4MTQ1', 'QWQzMDB4MjUw', 'QWQ3Mjh4OTA=', 'QWRBcmVh', 'QWRGcmFtZTE=', 'QWRGcmFtZTI=', 'QWRGcmFtZTM=', 'QWRGcmFtZTQ=', 'QWRMYXllcjE=', 'QWRMYXllcjI=', 'QWRzX2dvb2dsZV8wMQ==', 'QWRzX2dvb2dsZV8wMg==', 'QWRzX2dvb2dsZV8wMw==', 'QWRzX2dvb2dsZV8wNA==', 'RGl2QWQ=', 'RGl2QWQx', 'RGl2QWQy', 'RGl2QWQz', 'RGl2QWRB', 'RGl2QWRC', 'RGl2QWRD', 'QWRJbWFnZQ==', 'QWREaXY=', 'QWRCb3gxNjA=', 'QWRDb250YWluZXI=', 'Z2xpbmtzd3JhcHBlcg==', 'YWRUZWFzZXI=', 'YmFubmVyX2Fk', 'YWRCYW5uZXI=', 'YWRiYW5uZXI=', 'YWRBZA==', 'YmFubmVyYWQ=', 'IGFkX2JveA==', 'YWRfY2hhbm5lbA==', 'YWRzZXJ2ZXI=', 'YmFubmVyaWQ=', 'YWRzbG90', 'cG9wdXBhZA==', 'YWRzZW5zZQ==', 'Z29vZ2xlX2Fk', 'b3V0YnJhaW4tcGFpZA==', 'c3BvbnNvcmVkX2xpbms='],
y = Math.floor(Math.random() * a.length),
Y = t.decode(a[y]),
b = Y,
C = 1,
f = '#EEEEEE',
r = '#777777',
g = '#adb8ff',
w = '#FFFFFF',
Q = '',
W = 'Welcome!',
v = 'It looks like you\'re using an ad blocker. That\'s okay. Who doesn\'t?',
p = 'But without advertising-income, we can\'t keep making this site awesome.',
s = 'I understand, I have disabled my ad blocker. Let me in!',
o = 0,
u = 0,
n = 'moc.kcolbdakcolb',
l = 0,
M = e() + '.jpg';
function h(t) {
if (t) t = t.substr(t.length - 15);
var n = document.getElementsByTagName('script');
for (var o = n.length; o--;) {
var e = String(n[o].src);
if (e) e = e.substr(e.length - 15);
if (e === t) return !0
};
return !1
};
function m(t) {
if (t) t = t.substr(t.length - 15);
var e = document.styleSheets;
x = 0;
while (x < e.length) {
thisurl = e[x].href;
if (thisurl) thisurl = thisurl.substr(thisurl.length - 15);
if (thisurl === t) return !0;
x++
};
return !1
};
function e(t) {
var o = '',
e = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
t = t || 30;
for (var n = 0; n < t; n++) o += e.charAt(Math.floor(Math.random() * e.length));
return o
};
function i(o) {
var i = ['YWRuLmViYXkuY29t', 'YWQubWFpbC5ydQ==', 'anVpY3lhZHMuY29t', 'YWQuZm94bmV0d29ya3MuY29t', 'cGFydG5lcmFkcy55c20ueWFob28uY29t', 'YS5saXZlc3BvcnRtZWRpYS5ldQ==', 'YWdvZGEubmV0L2Jhbm5lcnM=', 'YWR2ZXJ0aXNpbmcuYW9sLmNvbQ==', 'Y2FzLmNsaWNrYWJpbGl0eS5jb20=', 'cHJvbW90ZS5wYWlyLmNvbQ==', 'YWRzLnlhaG9vLmNvbQ==', 'YWRzLnp5bmdhLmNvbQ==', 'YWRzYXR0LmFiY25ld3Muc3RhcndhdmUuY29t', 'YWRzYXR0LmVzcG4uc3RhcndhdmUuY29t', 'YXMuaW5ib3guY29t', 'cGFydG5lcmFkcy55c20ueWFob28uY29t'],
r = ['ZmF2aWNvbi5pY28=', 'YmFubmVyLmpwZw==', 'NDY4eDYwLmpwZw==', 'NzIweDkwLmpwZw==', 'c2t5c2NyYXBlci5qcGc=', 'MTM2N19hZC1jbGllbnRJRDI0NjQuanBn', 'YWRjbGllbnQtMDAyMTQ3LWhvc3QxLWJhbm5lci1hZC5qcGc=', 'Q0ROLTMzNC0xMDktMTM3eC1hZC1iYW5uZXI=', 'ZmF2aWNvbi5pY28=', 'YWQtbGFyZ2UucG5n', 'c3F1YXJlLWFkLnBuZw==', 'ZmF2aWNvbjEuaWNv', 'YmFubmVyX2FkLmdpZg==', 'bGFyZ2VfYmFubmVyLmdpZg==', 'd2lkZV9za3lzY3JhcGVyLmpwZw==', 'YWR2ZXJ0aXNlbWVudC0zNDMyMy5qcGc='];
x = 0;
spimg = [];
while (x < o) {
c = i[Math.floor(Math.random() * i.length)];
d = r[Math.floor(Math.random() * r.length)];
c = t.decode(c);
d = t.decode(d);
var a = Math.floor(Math.random() * 2) + 1;
if (a == 1) {
n = '//' + c + '/' + d
} else {
n = '//' + c + '/' + e(Math.floor(Math.random() * 20) + 4) + '.jpg'
};
spimg[x] = new Image();
spimg[x].onerror = function() {
var t = 1;
while (t < 7) {
t++
}
};
spimg[x].src = n;
x++
}
};
function A(t) {};
return {
ekgBSgaBPk: function(t, r) {
if (typeof document.body == 'undefined') {
return
};
var o = '0.1',
r = b,
e = document.createElement('DIV');
e.id = r;
e.style.position = 'absolute';
e.style.left = '-5000px';
e.style.top = '-5000px';
e.style.height = '60px';
e.style.width = '468px';
var d = document.body.childNodes,
a = Math.floor(d.length / 2);
if (a > 15) {
var n = document.createElement('div');
n.style.position = 'absolute';
n.style.height = '0px';
n.style.width = '0px';
n.style.top = '-5000px';
n.style.left = '-5000px';
document.body.insertBefore(n, document.body.childNodes[a]);
n.appendChild(e);
var i = document.createElement('DIV');
i.id = 'banner_ad';
i.style.position = 'absolute';
i.style.left = '-5000px';
i.style.top = '-5000px';
document.body.appendChild(i)
} else {
e.id = 'banner_ad';
document.body.appendChild(e)
};
l = setInterval(function() {
if (e) {
t((e.clientHeight == 0), o);
t((e.clientWidth == 0), o);
t((e.display == 'hidden'), o);
t((e.visibility == 'none'), o);
t((e.opacity == 0), o)
} else {
t(!0, o)
}
}, 1000)
},
bPqodbIKMt: function(e, m) {
if ((e) && (o == 0)) {
o = 1;
window['' + xcJQCflAmpis + ''].NhnwYPCjqO();
window['' + xcJQCflAmpis + ''].bPqodbIKMt = function() {
return
}
} else {
var p = t.decode('aW5zLmFkc2J5Z29vZ2xl'),
c = document.querySelector(p);
if ((c) && (o == 0)) {
if ((WSpSwDLzQd % 3) == 0) {
var d = 'Ly9wYWdlYWQyLmdvb2dsZXN5bmRpY2F0aW9uLmNvbS9wYWdlYWQvanMvYWRzYnlnb29nbGUuanM=';
d = t.decode(d);
if (h(d)) {
if (c.innerHTML.replace(/\s/g, '').length == 0) {
o = 1;
window['' + xcJQCflAmpis + ''].NhnwYPCjqO()
}
}
}
};
var f = !1;
if (o == 0) {
if ((nsJjjBITZC % 3) == 0) {
if (!window['' + xcJQCflAmpis + ''].ranAlready) {
var l = ['Ly93d3cuZ29vZ2xlLmNvbS9hZHNlbnNlL3N0YXJ0L2ltYWdlcy9mYXZpY29uLmljbw==', 'Ly93d3cuZ3N0YXRpYy5jb20vYWR4L2RvdWJsZWNsaWNrLmljbw==', 'Ly9hZHZlcnRpc2luZy55YWhvby5jb20vZmF2aWNvbi5pY28=', 'Ly9hZHMudHdpdHRlci5jb20vZmF2aWNvbi5pY28=', 'Ly93d3cuZG91YmxlY2xpY2tieWdvb2dsZS5jb20vZmF2aWNvbi5pY28='],
s = l.length,
r = l[Math.floor(Math.random() * s)],
n = r;
while (r == n) {
n = l[Math.floor(Math.random() * s)]
};
r = t.decode(r);
n = t.decode(n);
i(Math.floor(Math.random() * 2) + 1);
var a = new Image(),
u = new Image();
a.onerror = function() {
i(Math.floor(Math.random() * 2) + 1);
u.src = n;
i(Math.floor(Math.random() * 2) + 1)
};
u.onerror = function() {
o = 1;
i(Math.floor(Math.random() * 3) + 1);
window['' + xcJQCflAmpis + ''].NhnwYPCjqO()
};
a.src = r;
if ((neMuFFBFgq % 3) == 0) {
a.onload = function() {
if ((a.width < 8) && (a.width > 0)) {
window['' + xcJQCflAmpis + ''].NhnwYPCjqO()
}
}
};
i(Math.floor(Math.random() * 3) + 1);
window['' + xcJQCflAmpis + ''].ranAlready = !0
};
window['' + xcJQCflAmpis + ''].bPqodbIKMt = function() {
return
}
}
}
}
},
NhnwYPCjqO: function() {
if (u == 1) {
var C = sessionStorage.getItem('babn');
if (C > 0) {
return !0
} else {
sessionStorage.setItem('babn', (Math.random() + 1) * 1000)
}
};
var c = 'Ly95dWkueWFob29hcGlzLmNvbS8zLjE4LjEvYnVpbGQvY3NzcmVzZXQvY3NzcmVzZXQtbWluLmNzcw==';
c = t.decode(c);
if (!m(c)) {
var h = document.createElement('link');
h.setAttribute('rel', 'stylesheet');
h.setAttribute('type', 'text/css');
h.setAttribute('href', c);
document.getElementsByTagName('head')[0].appendChild(h)
};
clearInterval(l);
document.body.innerHTML = '';
document.body.style.cssText += 'margin:0px !important';
document.body.style.cssText += 'padding:0px !important';
var Q = document.documentElement.clientWidth || window.innerWidth || document.body.clientWidth,
y = window.innerHeight || document.body.clientHeight || document.documentElement.clientHeight,
a = document.createElement('DIV'),
b = e();
a.id = b;
a.style.position = 'fixed';
a.style.left = '0';
a.style.top = '0';
a.style.width = Q + 'px';
a.style.height = y + 'px';
a.style.backgroundColor = f;
a.style.zIndex = '9999';
document.body.appendChild(a);
var d = '<a href="http://blockadblock.com"><svg id="FILLVECTID1" width="160" height="40"><image id="FILLVECTID2" width="160" height="40" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAAoCAMAAABO8gGqAAAB+1BMVEXr6+sAAADr6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+sAAADMAAAsKysKCgokJCRycnIEBATq6uoUFBTMzMzr6urjqqoSEhIGBgaxsbHcd3dYWFg0NDTmw8PZY2M5OTkfHx+enp7TNTUoJyfm5ualpaV5eXkODg7k5OTaamoqKSnc3NzZ2dmHh4dra2tHR0fVQUFAQEDPExPNBQXo6Ohvb28ICAjp19fS0tLnzc29vb25ubm1tbWWlpaNjY3dfX1oaGhUVFRMTEwaGhoXFxfq5ubh4eHe3t7Hx8fgk5PfjY3eg4OBgYF+fn5EREQ9PT3SKSnV1dXks7OsrKypqambmpqRkZFdXV1RUVHRISHQHR309PTq4eHp3NzPz8/Ly8vKysrDw8O4uLjkt7fhnJzgl5d7e3tkZGTYVlZPT08vLi7OCwu/v792dnbbdHTZYWHZXl7YWlpZWVnVRkYnJib8/PzNzc3myMjlurrjsLDhoaHdf3/aa2thYWHXUFDUPDzUOTno0dHipqbceHjaZ2dCQkLSLy/v7+/b29vlvb2xn5/ejIzabW26SkqgMDA7HByRAADoM7kjAAAAInRSTlM6ACT4xhkPtY5iNiAI9PLv6drSpqGYclpM5bengkQ8NDAnsGiGMwAABetJREFUWMPN2GdTE1EYhmFQ7L339
You can partially deobfuscate it simply by removing the eval() that the code is wrapped inside. The entirety of the code that's inside the eval() will return the stringified code so you just need to run it to get that string.
Sidenote: I usually use the JsFormat plugin for Sublime Text for that. It evaluates the content of the eval() and also nicely formats the code afterwards.
Here is a full blockadblock standard script that you ask, just copy it and paste anywehere after open "body" and before closed "body" tag. Also you can change everything in this code, like: bgcolor, font, text, logo, button, delay time... everything.. in the end of the script. You'll see.
Your page code must be like this:
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
</head>
<body>
<script type="text/javascript" charset="utf-8">
// Place this code snippet near the footer of your page before the close of the /body tag
// LEGAL NOTICE: The content of this website and all associated program code are protected under the Digital Millennium Copyright Act. Intentionally circumventing this code may constitute a violation of the DMCA.
eval(function(p,a,c,k,e,d){
e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){
while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}
return p});
var xcJQCflAmpis = '',
KkUCuxqIgh = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
for (var i = 0; i < 12; i++) xcJQCflAmpis += KkUCuxqIgh.charAt(Math.floor(Math.random() * KkUCuxqIgh.length));
var VABjXzYzJp = 8, //-- delay time in seconds
WSpSwDLzQd = 91,
nsJjjBITZC = 178,
neMuFFBFgq = 19,
rMwHazIJjv = function (t) {
var o = !1,
i = function () {
if (document.addEventListener) {
document.removeEventListener('DOMContentLoaded', e);
window.removeEventListener('load', e)
} else {
document.detachEvent('onreadystatechange', e);
window.detachEvent('onload', e)
}
},
e = function () {
if (!o && (document.addEventListener || event.type === 'load' || document.readyState === 'complete')) {
o = !0;
i();
t()
}
};
if (document.readyState === 'complete') {
t()
} else if (document.addEventListener) {
document.addEventListener('DOMContentLoaded', e);
window.addEventListener('load', e)
} else {
document.attachEvent('onreadystatechange', e);
window.attachEvent('onload', e);
var n = !1;
try {
n = window.frameElement == null && document.documentElement
} catch (r) {};
if (n && n.doScroll) {
(function a() {
if (o) return;
try {
n.doScroll('left')
} catch (e) {
return setTimeout(a, 50)
};
o = !0;
i();
t()
})()
}
}
};
window['' + xcJQCflAmpis + ''] = (function () {
var t = {
t$: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=',
encode: function (e) {
var d = '',
l, r, i, s, c, a, n, o = 0;
e = t.n$(e);
while (o < e.length) {
l = e.charCodeAt(o++);
r = e.charCodeAt(o++);
i = e.charCodeAt(o++);
s = l >> 2;
c = (l & 3) << 4 | r >> 4;
a = (r & 15) << 2 | i >> 6;
n = i & 63;
if (isNaN(r)) {
a = n = 64
} else if (isNaN(i)) {
n = 64
};
d = d + this.t$.charAt(s) + this.t$.charAt(c) + this.t$.charAt(a) + this.t$.charAt(n)
};
return d
},
decode: function (e) {
var n = '',
l, c, d, s, r, i, a, o = 0;
e = e.replace(/[^A-Za-z0-9\+\/\=]/g, '');
while (o < e.length) {
s = this.t$.indexOf(e.charAt(o++));
r = this.t$.indexOf(e.charAt(o++));
i = this.t$.indexOf(e.charAt(o++));
a = this.t$.indexOf(e.charAt(o++));
l = s << 2 | r >> 4;
c = (r & 15) << 4 | i >> 2;
d = (i & 3) << 6 | a;
n = n + String.fromCharCode(l);
if (i != 64) {
n = n + String.fromCharCode(c)
};
if (a != 64) {
n = n + String.fromCharCode(d)
}
};
n = t.e$(n);
return n
},
n$: function (t) {
t = t.replace(/;/g, ';');
var n = '';
for (var o = 0; o < t.length; o++) {
var e = t.charCodeAt(o);
if (e < 128) {
n += String.fromCharCode(e)
} else if (e > 127 && e < 2048) {
n += String.fromCharCode(e >> 6 | 192);
n += String.fromCharCode(e & 63 | 128)
} else {
n += String.fromCharCode(e >> 12 | 224);
n += String.fromCharCode(e >> 6 & 63 | 128);
n += String.fromCharCode(e & 63 | 128)
}
};
return n
},
e$: function (t) {
var o = '',
e = 0,
n = c1 = c2 = 0;
while (e < t.length) {
n = t.charCodeAt(e);
if (n < 128) {
o += String.fromCharCode(n);
e++
} else if (n > 191 && n < 224) {
c2 = t.charCodeAt(e + 1);
o += String.fromCharCode((n & 31) << 6 | c2 & 63);
e += 2
} else {
c2 = t.charCodeAt(e + 1);
c3 = t.charCodeAt(e + 2);
o += String.fromCharCode((n & 15) << 12 | (c2 & 63) << 6 | c3 & 63);
e += 3
}
};
return o
}
};
var a = ['YWQtbGVmdA==', 'YWRCYW5uZXJXcmFw', 'YWQtZnJhbWU=', 'YWQtaGVhZGVy', 'YWQtaW1n', 'YWQtaW5uZXI=', 'YWQtbGFiZWw=', 'YWQtbGI=', 'YWQtZm9vdGVy', 'YWQtY29udGFpbmVy', 'YWQtY29udGFpbmVyLTE=', 'YWQtY29udGFpbmVyLTI=', 'QWQzMDB4MTQ1', 'QWQzMDB4MjUw', 'QWQ3Mjh4OTA=', 'QWRBcmVh', 'QWRGcmFtZTE=', 'QWRGcmFtZTI=', 'QWRGcmFtZTM=', 'QWRGcmFtZTQ=', 'QWRMYXllcjE=', 'QWRMYXllcjI=', 'QWRzX2dvb2dsZV8wMQ==', 'QWRzX2dvb2dsZV8wMg==', 'QWRzX2dvb2dsZV8wMw==', 'QWRzX2dvb2dsZV8wNA==', 'RGl2QWQ=', 'RGl2QWQx', 'RGl2QWQy', 'RGl2QWQz', 'RGl2QWRB', 'RGl2QWRC', 'RGl2QWRD', 'QWRJbWFnZQ==', 'QWREaXY=', 'QWRCb3gxNjA=', 'QWRDb250YWluZXI=', 'Z2xpbmtzd3JhcHBlcg==', 'YWRUZWFzZXI=', 'YmFubmVyX2Fk', 'YWRCYW5uZXI=', 'YWRiYW5uZXI=', 'YWRBZA==', 'YmFubmVyYWQ=', 'IGFkX2JveA==', 'YWRfY2hhbm5lbA==', 'YWRzZXJ2ZXI=', 'YmFubmVyaWQ=', 'YWRzbG90', 'cG9wdXBhZA==', 'YWRzZW5zZQ==', 'Z29vZ2xlX2Fk', 'b3V0YnJhaW4tcGFpZA==', 'c3BvbnNvcmVkX2xpbms='],
y = Math.floor(Math.random() * a.length),
Y = t.decode(a[y]),
b = Y,
C = 1,
f = '#EEEEEE', //-- colors
r = '#777777',
g = '#adb8ff',
w = '#FFFFFF',
Q = '',
W = 'Welcome!', //-- text
v = 'It looks like you\'re using an ad blocker. That\'s okay. Who doesn\'t?',
p = 'But without advertising-income, we can\'t keep making this site awesome.',
s = 'I understand, I have disabled my ad blocker. Let me in!',
o = 0,
u = 0,
n = 'moc.kcolbdakcolb', //-- blockaddblock.com link in left bottom
l = 0,
M = e() + '.jpg';
function h(t) {
if (t) t = t.substr(t.length - 15);
var n = document.getElementsByTagName('script');
for (var o = n.length; o--;) {
var e = String(n[o].src);
if (e) e = e.substr(e.length - 15);
if (e === t) return !0
};
return !1
};
function m(t) {
if (t) t = t.substr(t.length - 15);
var e = document.styleSheets;
x = 0;
while (x < e.length) {
thisurl = e[x].href;
if (thisurl) thisurl = thisurl.substr(thisurl.length - 15);
if (thisurl === t) return !0;
x++
};
return !1
};
function e(t) {
var o = '',
e = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
t = t || 30;
for (var n = 0; n < t; n++) o += e.charAt(Math.floor(Math.random() * e.length));
return o
};
function i(o) {
var i = ['YWRuLmViYXkuY29t', 'YWQubWFpbC5ydQ==', 'anVpY3lhZHMuY29t', 'YWQuZm94bmV0d29ya3MuY29t', 'cGFydG5lcmFkcy55c20ueWFob28uY29t', 'YS5saXZlc3BvcnRtZWRpYS5ldQ==', 'YWdvZGEubmV0L2Jhbm5lcnM=', 'YWR2ZXJ0aXNpbmcuYW9sLmNvbQ==', 'Y2FzLmNsaWNrYWJpbGl0eS5jb20=', 'cHJvbW90ZS5wYWlyLmNvbQ==', 'YWRzLnlhaG9vLmNvbQ==', 'YWRzLnp5bmdhLmNvbQ==', 'YWRzYXR0LmFiY25ld3Muc3RhcndhdmUuY29t', 'YWRzYXR0LmVzcG4uc3RhcndhdmUuY29t', 'YXMuaW5ib3guY29t', 'cGFydG5lcmFkcy55c20ueWFob28uY29t'],
r = ['ZmF2aWNvbi5pY28=', 'YmFubmVyLmpwZw==', 'NDY4eDYwLmpwZw==', 'NzIweDkwLmpwZw==', 'c2t5c2NyYXBlci5qcGc=', 'MTM2N19hZC1jbGllbnRJRDI0NjQuanBn', 'YWRjbGllbnQtMDAyMTQ3LWhvc3QxLWJhbm5lci1hZC5qcGc=', 'Q0ROLTMzNC0xMDktMTM3eC1hZC1iYW5uZXI=', 'ZmF2aWNvbi5pY28=', 'YWQtbGFyZ2UucG5n', 'c3F1YXJlLWFkLnBuZw==', 'ZmF2aWNvbjEuaWNv', 'YmFubmVyX2FkLmdpZg==', 'bGFyZ2VfYmFubmVyLmdpZg==', 'd2lkZV9za3lzY3JhcGVyLmpwZw==', 'YWR2ZXJ0aXNlbWVudC0zNDMyMy5qcGc='];
x = 0;
spimg = [];
while (x < o) {
c = i[Math.floor(Math.random() * i.length)];
d = r[Math.floor(Math.random() * r.length)];
c = t.decode(c);
d = t.decode(d);
var a = Math.floor(Math.random() * 2) + 1;
if (a == 1) {
n = '//' + c + '/' + d
} else {
n = '//' + c + '/' + e(Math.floor(Math.random() * 20) + 4) + '.jpg'
};
spimg[x] = new Image();
spimg[x].onerror = function () {
var t = 1;
while (t < 7) {
t++
}
};
spimg[x].src = n;
x++
}
};
function A(t) {};
return {
ekgBSgaBPk: function (t, r) {
if (typeof document.body == 'undefined') {
return
};
var o = '0.1',
r = b,
e = document.createElement('DIV');
e.id = r;
e.style.position = 'absolute';
e.style.left = '-5000px';
e.style.top = '-5000px';
e.style.height = '60px';
e.style.width = '468px';
var d = document.body.childNodes,
a = Math.floor(d.length / 2);
if (a > 15) {
var n = document.createElement('div');
n.style.position = 'absolute';
n.style.height = '0px';
n.style.width = '0px';
n.style.top = '-5000px';
n.style.left = '-5000px';
document.body.insertBefore(n, document.body.childNodes[a]);
n.appendChild(e);
var i = document.createElement('DIV');
i.id = 'banner_ad';
i.style.position = 'absolute';
i.style.left = '-5000px';
i.style.top = '-5000px';
document.body.appendChild(i)
} else {
e.id = 'banner_ad';
document.body.appendChild(e)
};
l = setInterval(function () {
if (e) {
t((e.clientHeight == 0), o);
t((e.clientWidth == 0), o);
t((e.display == 'hidden'), o);
t((e.visibility == 'none'), o);
t((e.opacity == 0), o)
} else {
t(!0, o)
}
}, 1000)
},
bPqodbIKMt: function (e, m) {
if ((e) && (o == 0)) {
o = 1;
window['' + xcJQCflAmpis + ''].NhnwYPCjqO();
window['' + xcJQCflAmpis + ''].bPqodbIKMt = function () {
return
}
} else {
var p = t.decode('aW5zLmFkc2J5Z29vZ2xl'),
c = document.querySelector(p);
if ((c) && (o == 0)) {
if ((WSpSwDLzQd % 3) == 0) {
var d = 'Ly9wYWdlYWQyLmdvb2dsZXN5bmRpY2F0aW9uLmNvbS9wYWdlYWQvanMvYWRzYnlnb29nbGUuanM=';
d = t.decode(d);
if (h(d)) {
if (c.innerHTML.replace(/\s/g, '').length == 0) {
o = 1;
window['' + xcJQCflAmpis + ''].NhnwYPCjqO()
}
}
}
};
var f = !1;
if (o == 0) {
if ((nsJjjBITZC % 3) == 0) {
if (!window['' + xcJQCflAmpis + ''].ranAlready) {
var l = ['Ly93d3cuZ29vZ2xlLmNvbS9hZHNlbnNlL3N0YXJ0L2ltYWdlcy9mYXZpY29uLmljbw==', 'Ly93d3cuZ3N0YXRpYy5jb20vYWR4L2RvdWJsZWNsaWNrLmljbw==', 'Ly9hZHZlcnRpc2luZy55YWhvby5jb20vZmF2aWNvbi5pY28=', 'Ly9hZHMudHdpdHRlci5jb20vZmF2aWNvbi5pY28=', 'Ly93d3cuZG91YmxlY2xpY2tieWdvb2dsZS5jb20vZmF2aWNvbi5pY28='],
s = l.length,
r = l[Math.floor(Math.random() * s)],
n = r;
while (r == n) {
n = l[Math.floor(Math.random() * s)]
};
r = t.decode(r);
n = t.decode(n);
i(Math.floor(Math.random() * 2) + 1);
var a = new Image(),
u = new Image();
a.onerror = function () {
i(Math.floor(Math.random() * 2) + 1);
u.src = n;
i(Math.floor(Math.random() * 2) + 1)
};
u.onerror = function () {
o = 1;
i(Math.floor(Math.random() * 3) + 1);
window['' + xcJQCflAmpis + ''].NhnwYPCjqO()
};
a.src = r;
if ((neMuFFBFgq % 3) == 0) {
a.onload = function () {
if ((a.width < 8) && (a.width > 0)) {
window['' + xcJQCflAmpis + ''].NhnwYPCjqO()
}
}
};
i(Math.floor(Math.random() * 3) + 1);
window['' + xcJQCflAmpis + ''].ranAlready = !0
};
window['' + xcJQCflAmpis + ''].bPqodbIKMt = function () {
return
}
}
}
}
},
NhnwYPCjqO: function () {
if (u == 1) {
var C = sessionStorage.getItem('babn');
if (C > 0) {
return !0
} else {
sessionStorage.setItem('babn', (Math.random() + 1) * 1000)
}
};
var c = 'Ly95dWkueWFob29hcGlzLmNvbS8zLjE4LjEvYnVpbGQvY3NzcmVzZXQvY3NzcmVzZXQtbWluLmNzcw==';
c = t.decode(c);
if (!m(c)) {
var h = document.createElement('link');
h.setAttribute('rel', 'stylesheet');
h.setAttribute('type', 'text/css');
h.setAttribute('href', c);
document.getElementsByTagName('head')[0].appendChild(h)
};
clearInterval(l);
document.body.innerHTML = '';
document.body.style.cssText += 'margin:0px !important';
document.body.style.cssText += 'padding:0px !important';
var Q = document.documentElement.clientWidth || window.innerWidth || document.body.clientWidth,
y = window.innerHeight || document.body.clientHeight || document.documentElement.clientHeight,
a = document.createElement('DIV'),
b = e();
a.id = b;
a.style.position = 'fixed';
a.style.left = '0';
a.style.top = '0';
a.style.width = Q + 'px';
a.style.height = y + 'px';
a.style.backgroundColor = f;
a.style.zIndex = '9999';
document.body.appendChild(a); //-- original link, you can delete or change
var d = '<svg id="FILLVECTID1" width="160" height="40"><image id="FILLVECTID2" width="160" height="40" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAAoCAMAAABO8gGqAAAB+1BMVEXr6+sAAADr6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+vr6+sAAADMAAAsKysKCgokJCRycnIEBATq6uoUFBTMzMzr6urjqqoSEhIGBgaxsbHcd3dYWFg0NDTmw8PZY2M5OTkfHx+enp7TNTUoJyfm5ualpaV5eXkODg7k5OTaamoqKSnc3NzZ2dmHh4dra2tHR0fVQUFAQEDPExPNBQXo6Ohvb28ICAjp19fS0tLnzc29vb25ubm1tbWWlpaNjY3dfX1oaGhUVFRMTEwaGhoXFxfq5ub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kj8y2dCw/Kq8b7m0RpwasnR/uJylU+dEflqX6gzC4hd1jSgz0ujmPkygDjvNYDsU0ZggjKBqLPrQLfDUQIzxMBtSOucRwLzrdQ2DFO0NDdnsYq0yoJyEB0FHTBHefyxcyUy8jflH7sHszSfgath4hYwcD3M29I5DMzdBNO2IFcC5y6HSduof4G5dQNMWd4cDcjNNeNGmb02/Uv0LfPzlsBELZ+3eUeuATRaNMs0zfml+gkJocgFtzfMzwAAAABJRU5ErkJggg==">;</svg>';
d = d.replace('FILLVECTID1', e());
d = d.replace('FILLVECTID2', e());
var i = document.createElement('DIV');
i.innerHTML = d;
i.style.position = 'absolute';
i.style.bottom = '30px';
i.style.left = '30px';
i.style.width = '160px';
i.style.height = '40px';
i.style.zIndex = '10000';
i.style.opacity = '.6';
i.style.cursor = 'pointer';
i.addEventListener('click', function () {
n = n.split('').reverse().join('');
window.location.href = '//' + n
});
document.getElementById(b).appendChild(i);
var o = document.createElement('DIV'),
Z = e();
o.id = Z;
o.style.position = 'fixed';
o.style.top = y / 7 + 'px';
o.style.minWidth = Q - 120 + 'px';
o.style.minHeight = y / 3.5 + 'px';
o.style.backgroundColor = '#fff';
o.style.zIndex = '10000';
o.style.cssText += 'font-family: "Arial Black", Helvetica, geneva, sans-serif !important';
o.style.cssText += 'line-height: normal !important';
o.style.cssText += 'font-size: 16pt !important';
o.style.cssText += 'text-align: center !important';
o.style.cssText += 'padding: 12px !important';
o.style.display += 'block';
o.style.marginLeft = '30px';
o.style.marginRight = '30px';
o.style.borderRadius = '15px';
document.body.appendChild(o);
o.style.boxShadow = '0px 14px 24px -8px rgba(0,0,0,0.3)';
o.style.visibility = 'visible';
var Y = 30,
A = 22,
x = 18,
M = 18;
if ((window.innerWidth < 640) || (screen.width < 640)) {
o.style.zoom = '50%';
o.style.cssText += 'font-size: 18pt !important';
o.style.marginLeft = '45px;';
i.style.zoom = '65%';
var Y = 22,
A = 18,
x = 12,
M = 12
}; //-- here is your adblock warning page
o.innerHTML = '<h3 style="color:#999;font-size:' + Y + 'pt;color:' + r + ';font-family:Helvetica, geneva, sans-serif;font-weight:200;margin-top:10px;margin-bottom:10px;text-align:center;">' + W + '</h3><h1 style="font-size:' + A + 'pt;font-weight:500;font-family:Helvetica, geneva, sans-serif;color:' + r + ';margin-top:10px;margin-bottom:10px;text-align:center;">' + v + '</h1><hr style=" display: block;margin-top: 0.5em;margin-bottom: 0.5em;margin-left: auto;margin-right: auto; border:1px solid #CCC; width: 25%;text-align:center;"><p style="font-family:Helvetica, geneva, sans-serif;font-weight:300;font-size:' + x + 'pt;color:' + r + ';text-align:center;">' + p + '</p><p style="margin-top:35px;"><div onmouseover="this.style.opacity=.9;" onmouseout="this.style.opacity=1;" id="' + e() + '" style="cursor:pointer;font-size:' + M + 'pt;font-family:Helvetica, geneva, sans-serif; font-weight:300;border-radius:15px;padding:10px;background-color:' + g + ';color:' + w + ';padding-left:60px;padding-right:60px;width:60%;margin:auto;margin-top:10px;margin-bottom:10px;" onclick="window.location.reload();">' + s + '</div></p>'
}
}
})();
window.cfVDoTdmsN = function (t, e) {
var r = Date.now,
i = window.requestAnimationFrame,
a = r(),
n, o = function () {
r() - a < e ? n || i(o) : t()
};
i(o);
return {
clear: function () {
n = 1
}
}
};
var BGWRSzJxTu;
if (document.body) {
document.body.style.visibility = 'visible'
};
rMwHazIJjv(function () {
if (document.getElementById('babasbmsgx')) {
document.getElementById('babasbmsgx').style.visibility = 'hidden';
document.getElementById('babasbmsgx').style.display = 'none'
};
BGWRSzJxTu = window.cfVDoTdmsN(function () {
window['' + xcJQCflAmpis + ''].ekgBSgaBPk(window['' + xcJQCflAmpis + ''].bPqodbIKMt, window['' + xcJQCflAmpis + ''].nipmDSFuLH)
}, VABjXzYzJp * 1000)
});
</script>
</body>
Example (switch addblock on): http://besedka.ho.ua/adblock.html
Have fun ;)
My guess is script is Obfuscate using some tool.
Javascript Obfuscator converts the JavaScript source code into obfuscated and completely unreadable form, preventing it from analysing and theft. It's a 100% safe JavaScript minifier and the best JavaScript compressor
so to deobfuscate script you need secret key, which was used to Obfuscate.

How do I get rid of this JS error: TypeError: $(...).validate is not a function

I am using the following JS code from the fiddle provided in the answer here:
How to display messages from jQuery Validate plugin inside of Tooltipster tooltips?
Here's the fiddle: http://jsfiddle.net/kyK4G/
The error shows up on line 36, which is: submitHandler: function (form) { // for demo
And this is the error:
TypeError: $(...).validate is not a function
submitHandler: function (form) { // for demo
Code:
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
$(document).ready(function () {
// initialize tooltipster on text input elements
$('#myform input[type="text"]').tooltipster({
trigger: 'custom',
onlyOne: false,
position: 'right'
});
// initialize validate plugin on the form
$('#myform').validate({
errorPlacement: function (error, element) {
$(element).tooltipster('update', $(error).text());
$(element).tooltipster('show');
},
success: function (label, element) {
$(element).tooltipster('hide');
},
rules: {
field1: {
required: true,
email: true
},
field2: {
required: true,
minlength: 5
}
},
submitHandler: function (form) { // for demo
alert('valid form');
return false;
}
});
});
// no CDN - including plugin below
(function (d, f, g, b) {
var e = "tooltipster",
c = {
animation: "fade",
arrow: true,
arrowColor: "",
content: "",
delay: 200,
fixedWidth: 0,
maxWidth: 0,
functionBefore: function (l, m) {
m()
},
functionReady: function (l, m) {},
functionAfter: function (l) {},
icon: "(?)",
iconDesktop: false,
iconTouch: false,
iconTheme: ".tooltipster-icon",
interactive: false,
interactiveTolerance: 350,
offsetX: 0,
offsetY: 0,
onlyOne: true,
position: "top",
speed: 350,
timer: 0,
theme: ".tooltipster-default",
touchDevices: true,
trigger: "hover"
};
function h(m, l) {
this.element = m;
this.options = d.extend({}, c, l);
this._defaults = c;
this._name = e;
this.init()
}
function j() {
return !!("ontouchstart" in f)
}
function a() {
var l = g.body || g.documentElement;
var n = l.style;
var o = "transition";
if (typeof n[o] == "string") {
return true
}
v = ["Moz", "Webkit", "Khtml", "O", "ms"], o = o.charAt(0).toUpperCase() + o.substr(1);
for (var m = 0; m < v.length; m++) {
if (typeof n[v[m] + o] == "string") {
return true
}
}
return false
}
var k = true;
if (!a()) {
k = false
}
h.prototype = {
init: function () {
var r = d(this.element);
var n = this;
var q = true;
if ((n.options.touchDevices == false) && (j())) {
q = false
}
if (g.all && !g.querySelector) {
q = false
}
if (q == true) {
if ((this.options.iconDesktop == true) && (!j()) || ((this.options.iconTouch == true) && (j()))) {
var m = r.attr("title");
r.removeAttr("title");
var p = n.options.iconTheme;
var o = d('<span class="' + p.replace(".", "") + '" title="' + m + '">' + this.options.icon + "</span>");
o.insertAfter(r);
r.data("tooltipsterIcon", o);
r = o
}
var l = d.trim(n.options.content).length > 0 ? n.options.content : r.attr("title");
r.data("tooltipsterContent", l);
r.removeAttr("title");
if ((this.options.touchDevices == true) && (j())) {
r.bind("touchstart", function (t, s) {
n.showTooltip()
})
} else {
if (this.options.trigger == "hover") {
r.on("mouseenter.tooltipster", function () {
n.showTooltip()
});
if (this.options.interactive == true) {
r.on("mouseleave.tooltipster", function () {
var t = r.data("tooltipster");
var u = false;
if ((t !== b) && (t !== "")) {
t.mouseenter(function () {
u = true
});
t.mouseleave(function () {
u = false
});
var s = setTimeout(function () {
if (u == true) {
t.mouseleave(function () {
n.hideTooltip()
})
} else {
n.hideTooltip()
}
}, n.options.interactiveTolerance)
} else {
n.hideTooltip()
}
})
} else {
r.on("mouseleave.tooltipster", function () {
n.hideTooltip()
})
}
}
if (this.options.trigger == "click") {
r.on("click.tooltipster", function () {
if ((r.data("tooltipster") == "") || (r.data("tooltipster") == b)) {
n.showTooltip()
} else {
n.hideTooltip()
}
})
}
}
}
},
showTooltip: function (m) {
var n = d(this.element);
var l = this;
if (n.data("tooltipsterIcon") !== b) {
n = n.data("tooltipsterIcon")
}
if ((d(".tooltipster-base").not(".tooltipster-dying").length > 0) && (l.options.onlyOne == true)) {
d(".tooltipster-base").not(".tooltipster-dying").not(n.data("tooltipster")).each(function () {
d(this).addClass("tooltipster-kill");
var o = d(this).data("origin");
o.data("plugin_tooltipster").hideTooltip()
})
}
n.clearQueue().delay(l.options.delay).queue(function () {
l.options.functionBefore(n, function () {
if ((n.data("tooltipster") !== b) && (n.data("tooltipster") !== "")) {
var w = n.data("tooltipster");
if (!w.hasClass("tooltipster-kill")) {
var s = "tooltipster-" + l.options.animation;
w.removeClass("tooltipster-dying");
if (k == true) {
w.clearQueue().addClass(s + "-show")
}
if (l.options.timer > 0) {
var q = w.data("tooltipsterTimer");
clearTimeout(q);
q = setTimeout(function () {
w.data("tooltipsterTimer", b);
l.hideTooltip()
}, l.options.timer);
w.data("tooltipsterTimer", q)
}
if ((l.options.touchDevices == true) && (j())) {
d("body").bind("touchstart", function (B) {
if (l.options.interactive == true) {
var D = d(B.target);
var C = true;
D.parents().each(function () {
if (d(this).hasClass("tooltipster-base")) {
C = false
}
});
if (C == true) {
l.hideTooltip();
d("body").unbind("touchstart")
}
} else {
l.hideTooltip();
d("body").unbind("touchstart")
}
})
}
}
} else {
d("body").css("overflow-x", "hidden");
var x = n.data("tooltipsterContent");
var u = l.options.theme;
var y = u.replace(".", "");
var s = "tooltipster-" + l.options.animation;
var r = "-webkit-transition-duration: " + l.options.speed + "ms; -webkit-animation-duration: " + l.options.speed + "ms; -moz-transition-duration: " + l.options.speed + "ms; -moz-animation-duration: " + l.options.speed + "ms; -o-transition-duration: " + l.options.speed + "ms; -o-animation-duration: " + l.options.speed + "ms; -ms-transition-duration: " + l.options.speed + "ms; -ms-animation-duration: " + l.options.speed + "ms; transition-duration: " + l.options.speed + "ms; animation-duration: " + l.options.speed + "ms;";
var o = l.options.fixedWidth > 0 ? "width:" + l.options.fixedWidth + "px;" : "";
var z = l.options.maxWidth > 0 ? "max-width:" + l.options.maxWidth + "px;" : "";
var t = l.options.interactive == true ? "pointer-events: auto;" : "";
var w = d('<div class="tooltipster-base ' + y + " " + s + '" style="' + o + " " + z + " " + t + " " + r + '"><div class="tooltipster-content">' + x + "</div></div>");
w.appendTo("body");
n.data("tooltipster", w);
w.data("origin", n);
l.positionTooltip();
l.options.functionReady(n, w);
if (k == true) {
w.addClass(s + "-show")
} else {
w.css("display", "none").removeClass(s).fadeIn(l.options.speed)
}
var A = x;
var p = setInterval(function () {
var B = n.data("tooltipsterContent");
if (d("body").find(n).length == 0) {
w.addClass("tooltipster-dying");
l.hideTooltip()
} else {
if ((A !== B) && (B !== "")) {
A = B;
w.find(".tooltipster-content").html(B);
w.css({
width: "",
"-webkit-transition-duration": l.options.speed + "ms",
"-moz-transition-duration": l.options.speed + "ms",
"-o-transition-duration": l.options.speed + "ms",
"-ms-transition-duration": l.options.speed + "ms",
"transition-duration": l.options.speed + "ms",
"-webkit-transition-property": "-webkit-transform",
"-moz-transition-property": "-moz-transform",
"-o-transition-property": "-o-transform",
"-ms-transition-property": "-ms-transform",
"transition-property": "transform"
}).addClass("tooltipster-content-changing");
setTimeout(function () {
w.removeClass("tooltipster-content-changing");
setTimeout(function () {
w.css({
"-webkit-transition-property": "",
"-moz-transition-property": "",
"-o-transition-property": "",
"-ms-transition-property": "",
"transition-property": ""
})
}, l.options.speed)
}, l.options.speed);
tooltipWidth = w.outerWidth(false);
tooltipInnerWidth = w.innerWidth();
tooltipHeight = w.outerHeight(false);
l.positionTooltip()
}
}
if ((d("body").find(w).length == 0) || (d("body").find(n).length == 0)) {
clearInterval(p)
}
}, 200);
if (l.options.timer > 0) {
var q = setTimeout(function () {
w.data("tooltipsterTimer", b);
l.hideTooltip()
}, l.options.timer + l.options.speed);
w.data("tooltipsterTimer", q)
}
if ((l.options.touchDevices == true) && (j())) {
d("body").bind("touchstart", function (B) {
if (l.options.interactive == true) {
var D = d(B.target);
var C = true;
D.parents().each(function () {
if (d(this).hasClass("tooltipster-base")) {
C = false
}
});
if (C == true) {
l.hideTooltip();
d("body").unbind("touchstart")
}
} else {
l.hideTooltip();
d("body").unbind("touchstart")
}
})
}
w.mouseleave(function () {
l.hideTooltip()
})
}
});
n.dequeue()
})
},
hideTooltip: function (m) {
var p = d(this.element);
var l = this;
if (p.data("tooltipsterIcon") !== b) {
p = p.data("tooltipsterIcon")
}
var o = p.data("tooltipster");
if (o == b) {
o = d(".tooltipster-dying")
}
p.clearQueue();
if ((o !== b) && (o !== "")) {
var q = o.data("tooltipsterTimer");
if (q !== b) {
clearTimeout(q)
}
var n = "tooltipster-" + l.options.animation;
if (k == true) {
o.clearQueue().removeClass(n + "-show").addClass("tooltipster-dying").delay(l.options.speed).queue(function () {
o.remove();
p.data("tooltipster", "");
d("body").css("verflow-x", "");
l.options.functionAfter(p)
})
} else {
o.clearQueue().addClass("tooltipster-dying").fadeOut(l.options.speed, function () {
o.remove();
p.data("tooltipster", "");
d("body").css("verflow-x", "");
l.options.functionAfter(p)
})
}
}
},
positionTooltip: function (O) {
var A = d(this.element);
var ab = this;
if (A.data("tooltipsterIcon") !== b) {
A = A.data("tooltipsterIcon")
}
if ((A.data("tooltipster") !== b) && (A.data("tooltipster") !== "")) {
var ah = A.data("tooltipster");
ah.css("width", "");
var ai = d(f).width();
var B = A.outerWidth(false);
var ag = A.outerHeight(false);
var al = ah.outerWidth(false);
var m = ah.innerWidth() + 1;
var M = ah.outerHeight(false);
var aa = A.offset();
var Z = aa.top;
var u = aa.left;
var y = b;
if (A.is("area")) {
var T = A.attr("shape");
var af = A.parent().attr("name");
var P = d('img[usemap="#' + af + '"]');
var n = P.offset().left;
var L = P.offset().top;
var W = A.attr("coords") !== b ? A.attr("coords").split(",") : b;
if (T == "circle") {
var N = parseInt(W[0]);
var r = parseInt(W[1]);
var D = parseInt(W[2]);
ag = D * 2;
B = D * 2;
Z = L + r - D;
u = n + N - D
} else {
if (T == "rect") {
var N = parseInt(W[0]);
var r = parseInt(W[1]);
var q = parseInt(W[2]);
var J = parseInt(W[3]);
ag = J - r;
B = q - N;
Z = L + r;
u = n + N
} else {
if (T == "poly") {
var x = [];
var ae = [];
var H = 0,
G = 0,
ad = 0,
ac = 0;
var aj = "even";
for (i = 0; i < W.length; i++) {
var F = parseInt(W[i]);
if (aj == "even") {
if (F > ad) {
ad = F;
if (i == 0) {
H = ad
}
}
if (F < H) {
H = F
}
aj = "odd"
} else {
if (F > ac) {
ac = F;
if (i == 1) {
G = ac
}
}
if (F < G) {
G = F
}
aj = "even"
}
}
ag = ac - G;
B = ad - H;
Z = L + G;
u = n + H
} else {
ag = P.outerHeight(false);
B = P.outerWidth(false);
Z = L;
u = n
}
}
}
}
if (ab.options.fixedWidth == 0) {
ah.css({
width: m + "px",
"padding-left": "0px",
"padding-right": "0px"
})
}
var s = 0,
V = 0;
var X = parseInt(ab.options.offsetY);
var Y = parseInt(ab.options.offsetX);
var p = "";
function w() {
var an = d(f).scrollLeft();
if ((s - an) < 0) {
var am = s - an;
s = an;
ah.data("arrow-reposition", am)
}
if (((s + al) - an) > ai) {
var am = s - ((ai + an) - al);
s = (ai + an) - al;
ah.data("arrow-reposition", am)
}
}
function t(an, am) {
if (((Z - d(f).scrollTop() - M - X - 12) < 0) && (am.indexOf("top") > -1)) {
ab.options.position = an;
y = am
}
if (((Z + ag + M + 12 + X) > (d(f).scrollTop() + d(f).height())) && (am.indexOf("bottom") > -1)) {
ab.options.position = an;
y = am;
V = (Z - M) - X - 12
}
}
if (ab.options.position == "top") {
var Q = (u + al) - (u + B);
s = (u + Y) - (Q / 2);
V = (Z - M) - X - 12;
w();
t("bottom", "top")
}
if (ab.options.position == "top-left") {
s = u + Y;
V = (Z - M) - X - 12;
w();
t("bottom-left", "top-left")
}
if (ab.options.position == "top-right") {
s = (u + B + Y) - al;
V = (Z - M) - X - 12;
w();
t("bottom-right", "top-right")
}
if (ab.options.position == "bottom") {
var Q = (u + al) - (u + B);
s = u - (Q / 2) + Y;
V = (Z + ag) + X + 12;
w();
t("top", "bottom")
}
if (ab.options.position == "bottom-left") {
s = u + Y;
V = (Z + ag) + X + 12;
w();
t("top-left", "bottom-left")
}
if (ab.options.position == "bottom-right") {
s = (u + B + Y) - al;
V = (Z + ag) + X + 12;
w();
t("top-right", "bottom-right")
}
if (ab.options.position == "left") {
s = u - Y - al - 12;
myLeftMirror = u + Y + B + 12;
var K = (Z + M) - (Z + A.outerHeight(false));
V = Z - (K / 2) - X;
if ((s < 0) && ((myLeftMirror + al) > ai)) {
var o = parseFloat(ah.css("border-width")) * 2;
var l = (al + s) - o;
ah.css("width", l + "px");
M = ah.outerHeight(false);
s = u - Y - l - 12 - o;
K = (Z + M) - (Z + A.outerHeight(false));
V = Z - (K / 2) - X
} else {
if (s < 0) {
s = u + Y + B + 12;
ah.data("arrow-reposition", "left")
}
}
}
if (ab.options.position == "right") {
s = u + Y + B + 12;
myLeftMirror = u - Y - al - 12;
var K = (Z + M) - (Z + A.outerHeight(false));
V = Z - (K / 2) - X;
if (((s + al) > ai) && (myLeftMirror < 0)) {
var o = parseFloat(ah.css("border-width")) * 2;
var l = (ai - s) - o;
ah.css("width", l + "px");
M = ah.outerHeight(false);
K = (Z + M) - (Z + A.outerHeight(false));
V = Z - (K / 2) - X
} else {
if ((s + al) > ai) {
s = u - Y - al - 12;
ah.data("arrow-reposition", "right")
}
}
}
if (ab.options.arrow == true) {
var I = "tooltipster-arrow-" + ab.options.position;
if (ab.options.arrowColor.length < 1) {
var R = ah.css("background-color")
} else {
var R = ab.options.arrowColor
}
It sounds like you don't have the validate plugin script on the page:
http://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js
It looks like you are not including the jQuery plugin that provides the .validate() method. You should include it after jQuery:
<script src="//ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js"><script>
Generally, if you have an object, you can try and access different attributes using dot notation as follows:
var myAwesomeObject = {
coolProperty: "whooooa!"
, coolMethod: function() {return this;}
};
myAwesomeObject.coolProperty; // "whooooa!"
myAwesomeObject.coolMethod; // function(){return this;}
If the property happens to be a method, you can call it like:
myAwesomeObject.coolMethod(); // Object {coolProperty: ...
If the property you are trying to access doesn't exist on the object, you will get back undefined
myAwesomeObject.missingProperty; // undefined
Since undefined is not a function, trying to call a missing property as a method will result in the error you saw:
myAwesomeObject.missingMethod(); // TypeError: you messed up.
I also got this problem. I have fixed this problem other way. That I got in the documentation
To fix the problem you have to declared a specific class.
Using the
mfp-TYPE CSS class (where TYPE is the desired content type). For example: <a class="mfp-image image-link">Open image</a>, $('.image-link').magnificPopup().
Another Example: <a class="mfp-iframe video-link">Open Video</a>, $('.video-link').magnificPopup().

Categories