#likejacking { position: relative; } #likejacking img { cursor: pointer; margin-bottom: 10px; } #fbframe { width: 2px; height: 2px; overflow: hidden; position: absolute; top: 0; left: 0; } #toggleevil { background: #222; color: white; font-size: 1.3em; padding: 5px 15px; text-decoration: none; } #toggleevil:hover { background: black; } #warning { padding: 20px 20px; margin-top: 20px; border: 3px dotted red; } #warning h3 { font-size: 2.4em; padding-bottom: 8px; } #warning p { font-size: 1.4em; line-height: 1.5em; } #warning a { color: black; background: #79B556; padding: 3px 5px; text-decoration: none; } #punked { font-size: 1.4em; padding: 50px; } #punked h1 { font-size: 6em; }
$(document).ready(function() { var img = $('#likejacking img'), imgOffset = img.offset(), imgTop = imgOffset.top, imgLeft = imgOffset.left, fbframe = $('#fbframe'); img.mousemove(function(event) { fbframe.css({ top : event.pageY - imgTop, left: event.pageX - imgLeft }); }); $('#toggleevil').toggle(function() { $(this).text('Hide the Facebook Like Button'); fbframe.width('auto').height(26); }, function() { $(this).text('Show the Facebook Like Button'); fbframe.width(2).height(2); }); //register a callback after Like is created FB.Event.subscribe('edge.create', function() { $.fancybox('Unlike if you want: