我想知道如何将模糊边缘阴影添加到Raphael.js对象/路径中。据我所知,用这个库是不可能的,但是有没有办法呢?
发布于 2010-10-08 03:33:56
根据OP的请求,在单独的答案中添加到Raphael.blur的链接。
http://github.com/DmitryBaranovskiy/raphael/blob/master/plugins/raphael.blur.js
更新的代码示例:
var shadow = canvas.path(p);
shadow.attr({stroke: "none", fill: "#555", translation: "4,4"});
shadow.blur(4);
var shape = canvas.path(p);
请注意,在Dmitry的评论中,他提到没有WebKit支持。他使用<filter>
元素和feGaussianBlur滤镜效果。WebKit已经实现了feGaussianBlur效果,但是滤镜是unstable的,并且在Safari中被禁用(它可能在Chrome5中工作-应该在Chrome6中工作)。
发布于 2012-04-26 15:45:17
您可以使用Element.glow([glow])
来获得阴影效果。http://raphaeljs.com/reference.html#Element.glow
发布于 2012-01-14 23:21:43
我写了一个插件,通过对元素应用SVG滤镜来添加阴影。它是基于模糊插件的。
https://stackoverflow.com/questions/3878436
复制相似问题