Maybe this is what you seek: two lines forming a cross, accompanying the mouse position:
var v = document.querySelector('.cursor-v');
var h = document.querySelector('.cursor-h');
var elBox = document.querySelector('.cursor').getBoundingClientRect();
window.onmousemove = function(e) {
var mouseX = e.clientX - elBox.left;
var mouseY = e.clientY - elBox.top;
h.style.top = mouseY + 'px';
v.style.left = mouseX + 'px';
};
html, body {
height: 100%;
}
.cursor {
position: relative;
width: 100%;
height: 100%;
}
.cursor-h {
position: absolute;
width: 100%;
height: 0;
border-top: 1px solid red;
}
.cursor-v {
position: absolute;
width: 0;
height: 100%;
border-left: 1px solid red;
}
<div class="cursor"><div class="cursor-h"></div><div class="cursor-v"></div></div>
Can you explain further what you want? There are graphics that have it already done... or that use still images as graphics and have those lines on top of the image?
– Sergio
I intend just the cursor. To be an image had to be big, and with that I could not move the objects with the cursor.
– akm