Skip to content

Instantly share code, notes, and snippets.

@vimyum
Created September 6, 2017 14:48
SpotLight JSS
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