Created
September 6, 2017 14:48
-
-
Save vimyum/d0c01a508b448da888b41084a0975db0 to your computer and use it in GitHub Desktop.
SpotLight JSS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ar toggle = false; | |
$('.searchlight') | |
.on('mousemove', function(event) { | |
$(this).addClass('on').css({'margin-left': event.pageX -150, 'margin-top': event.pageY -150}); | |
}) | |
.on('mouseout', function(event) { | |
$(this).removeClass('on'); | |
}) | |
.on('click', function() { | |
if (toggle) { | |
$(this).css('opacity', '0').css('cursor', 'auto'); | |
} else { | |
$(this).css('opacity', '1').css('cursor', 'none');; | |
} | |
toggle = !toggle; | |
}) | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment