2 * Raphael Blur Plugin 0.1
4 * Copyright (c) 2009 Dmitry Baranovskiy (http://raphaeljs.com)
5 * Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.
9 Raphael.el.blur = function (size) {
10 var s = this.node.style,
12 f = f.replace(/ progid:\S+Blur\([^\)]+\)/g, "");
14 s.filter = f + " progid:DXImageTransform.Microsoft.Blur(pixelradius=" + (+size || 1.5) + ")";
15 s.margin = Raphael.format("-{0}px 0 0 -{0}px", Math.round(+size || 1.5));
22 Raphael.el.blur = function (size) {
23 // Experimental. No WebKit support.
25 var fltr = $("filter"),
26 blur = $("feGaussianBlur");
27 fltr.id = "r" + (Raphael.idGenerator++).toString(36);
28 $(blur, {stdDeviation: +size || 1.5});
29 fltr.appendChild(blur);
30 this.paper.defs.appendChild(fltr);
32 $(this.node, {filter: "url(#" + fltr.id + ")"});
35 this._blur.parentNode.removeChild(this._blur);
38 this.node.removeAttribute("filter");