Pair of perpendicular lines that moves when the mouse moves.
HTML
<div id="crossHairX" style="cursor:default;width:100%;height:0;position:fixed;top:0;right:0;border-top:1px dashed green;"></div> <div id="crossHairY" style="cursor:default;width:0;height:100%;position:fixed;top:0;right:0;border-left:1px dashed olive;"></div>
JavaScript
var cX = document.getElementById("crossHairX"); var cY = document.getElementById("crossHairY"); cX.style.zIndex=10 cY.style.zIndex=10 document.body.addEventListener("mousemove",e=>{ cX.style.top=(e.clientY-2)+"px" cY.style.left=(e.clientX-2)+"px"
})
2 comments:
Hi I know it's not the main thing on this subject but.
how did u put a black / white theme.
it will be very useful to know it
It is not shown in the video, but I went to Visualizations > Canvas Styling > Dark / White Theme. There is no way at the moment to switch between one theme and the other programatically
Post a Comment