I need to center the mirlet jquery css

1

I have a peephole for a game made with jquery css and html, the cursor is in the top left in realdad not in the center of the sight, any suggestions? Thanks in advance the css is like this

cursor: url ("img / reticle.png"), auto;

    
asked by Alejandro Lorenzo Martínez 11.11.2018 в 12:56
source

1 answer

1

Well this is simple cursor can add when x and how much and in the end I add a simple and functional example in your case and in this as the image would be half the size of both in x and in and

<html>
<head>
  <style>
  body {
    background-color: #000000;
    color:#FFFFFF;
    cursor:url(https://i.stack.imgur.com/Ozdqm.png) 12 12, auto;
  }
  div {
    padding: 40px;
  }
  </style>
  <script src="https://code.jquery.com/jquery-1.10.2.js"></script>
</head>
<body>
 
<div id="area"></div>
 
<script>
$( document ).on( "mousemove", function( event ) {
  $( "#area" ).text( "X: " + event.pageX + ", Y: " + event.pageY );
});
</script>
 
 
 
</body>
</html>
    
answered by 11.11.2018 / 13:26
source