Customer Banners (Ads) - SpiceUp. AX and SpotfireX Disclaimer



If you find this site useful and you want to support, buy me a coffee   to keep this site alive and without ads.

Crosshair guides for visualizations

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:

Romain said...

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

Jose Leviaguirre said...

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