
Untitled
By: a guest on
Aug 23rd, 2012 | syntax:
None | size: 0.69 KB | hits: 8 | expires: Never
$(document).ready(function() {
// Use jquery to create custom tooltips that move with the mouse
$.each($('div.product-wrapper'), function(i, div) {
var anchor = $(div).parent();
var overlay = $(div).next();
var xPaddingPixels = 15;
var yPaddingPixels = 10;
anchor.mouseover(function(e) {
overlay.show();
overlay.css('left', e.pageX + xPaddingPixels);
overlay.css('top', e.pageY - yPaddingPixels);
});
anchor.mousemove(function(e) {
overlay.css('left', e.pageX + xPaddingPixels);
overlay.css('top', e.pageY - yPaddingPixels);
});
anchor.mouseout(function(e) {
overlay.hide();
});
});
});