JSFiddle - React, Tailwind, and code Playground

by mubarakpasha

HTML

<div>
    <img src="http://i574.photobucket.com/albums/ss184/wsganewsletter/Other/Icon-Mega.png" />
</div>

CSS

div { 
    height: 500px;
    width: 500px;
    background: #eee;
}

JavaScript

var $img = $('img');
$img.hide();
$('div').mousemove(function(e) {
    $img.stop(1, 1).fadeIn();
    $('img').offset({
        top: e.pageY - $img.outerHeight(),
        left: e.pageX - ($img.outerWidth()/2)
    });
}).mouseleave(function() {
    $img.fadeOut();
});