Skip to content

Instantly share code, notes, and snippets.

@ioseb
Created May 5, 2009 00:37
Show Gist options
  • Save ioseb/106753 to your computer and use it in GitHub Desktop.
Save ioseb/106753 to your computer and use it in GitHub Desktop.
$(function() {
function isValidTarget(node) {
return /^img|canvas$/i.test(node.nodeName);
};
$('div.entry table tbody td span').mouseenter(function(e) {
var target = e.target;
if (isValidTarget(target)) {
var img = new Image();
img.src = target.src || target.imgsrc;
img.setAttribute("style", target.getAttribute("style"));
target.parentNode.replaceChild(img, target);
}
}).mouseleave(function(e) {
var target = e.target;
if (isValidTarget(target)) {
Pixastic.process(target, "desaturate", false);
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment