Line 26: | Line 26: | ||
window.addEventListener('mousemove', function(event){ | window.addEventListener('mousemove', function(event){ | ||
x = event.clientX; | x = event.clientX; | ||
− | 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({"left": (x-20) + "px"}, 1); | ||
Line 32: | Line 32: | ||
} | } | ||
}, false); | }, false); | ||
− | } | + | }; |
− | + | </script> | |
+ | |||
+ | <script type="text/javascript"> | ||
+ | window.onload = function(){ | ||
+ | var xt, st; | ||
+ | |||
+ | window.addEventListener('mousemove', function(event){ | ||
+ | xt = $("#test").position(); | ||
+ | st = $("#box-shadow-div").position(); | ||
+ | if (xt.left == st.left){ | ||
+ | $("#test").animate({"opacity": '0'}, 200); | ||
+ | } | ||
+ | }, false); | ||
+ | } | ||
+ | </script> | ||
+ | |||
+ | |||
</head> | </head> | ||
Revision as of 20:46, 4 August 2016