X-Git-Url: https://dev.renevier.net/gitweb.cgi?a=blobdiff_plain;f=public%2Fjs%2Fhighlight.js;fp=public%2Fjs%2Fhighlight.js;h=289cd2a946078b5f7afa445e8ac9088565d9a1f9;hb=9efd079d59d269811abc4c551b2f39ab2e6a05fb;hp=0000000000000000000000000000000000000000;hpb=aa1b3365fcf3d78fbe20166a03fc92fab3928708;p=syj.git diff --git a/public/js/highlight.js b/public/js/highlight.js new file mode 100644 index 0000000..289cd2a --- /dev/null +++ b/public/js/highlight.js @@ -0,0 +1,12 @@ +Element.addMethods({ + highlight: function(element, color, timeout) { + var current; + if (typeof timeout === "undefined") { + timeout = 0.3; + } + current = element.getStyle('backgroundColor'); + Element.setStyle(element, {'backgroundColor': color}); + Element.setStyle.delay(timeout, element, {'backgroundColor': current}); + return element; + } +});