Created
May 5, 2009 00:37
-
-
Save ioseb/106753 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
$(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