Line 28: | Line 28: | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
window.onload = function(){ | window.onload = function(){ | ||
− | |||
var x, y; | var x, y; | ||
// On mousemove use event.clientX and event.clientY to set the location of the div to the location of the cursor: | // On mousemove use event.clientX and event.clientY to set the location of the div to the location of the cursor: | ||
Line 35: | Line 34: | ||
y = event.clientY; | y = event.clientY; | ||
if ( typeof x !== 'undefined' ){ | if ( typeof x !== 'undefined' ){ | ||
− | + | $("#box-shadow-div").animate({"left": (x-20) + "px"}, 1); | |
− | + | $("#box-shadow-div").animate({"top": (y-20) + "px"}, 1); | |
} | } | ||
}, false); | }, false); |
Revision as of 20:02, 4 August 2016