Hey there! I'm currently working on implementing a custom cursor for specific elements on my website. However, I've encountered a little hiccup - once the custom cursor is in place, I'm no longer able to click on any elements. Does anyone have any insight into what might be causing this issue?
$('a').on('click',function(){
alert('sad');
});
(function() {
var follower, init, mouseX, mouseY, positionElement, printout, timer;
follower = document.getElementById('follower');
printout = document.getElementById('printout');
mouseX = (function(_this) {
return function(event) {
return event.clientX;
};
})(this);
mouseY = (function(_this) {
return function(event) {
return event.clientY;
};
})(this);
positionElement = (function(_this) {
return function(event) {
var mouse;
mouse = {
x: mouseX(event),
y: mouseY(event)
};
follower.style.top = mouse.y + 'px';
return follower.style.left = mouse.x + 'px';
};
})(this);
timer = false;
window.onmousemove = init = (function(_this) {
return function(event) {
var _event;
_event = event;
return timer = setTimeout(function() {
return positionElement(_event);
}, 1);
};
})(this);
}).call(this);