Created
June 15, 2012 04:20
-
-
Save avargas/2934652 to your computer and use it in GitHub Desktop.
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
CSS: | |
#preview-foot { | |
position:absolute; | |
border:1px solid #ccc; | |
background:#333; | |
padding:5px; | |
display:none; | |
color:#fff; | |
} | |
$(document).ready(function () { | |
var $each = $('ul.thumbprem a'); | |
$each.hover(function(e) { | |
var url = $(this).find('img').attr('href').replace(/\.jpg$/, /\-big\.jpg/); | |
$("body").append("<div id='preview-foot'><img src='"+ url +"' /></div>"); | |
$("#preview-foot") | |
.css("top", (e.pageY - xOffset) + "px") | |
.css("left", (e.pageX + yOffset) + "px") | |
.fadeIn("fast"); | |
}, | |
function(){ | |
$("#preview").remove(); | |
}); | |
$each.mousemove(function(e){ | |
$("#preview-image") | |
.css("top",(e.pageY - xOffset) + "px") | |
.css("left",(e.pageX + yOffset) + "px"); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment