拉斐尔投影效果

Joh*_*Doe 5 javascript shadow raphael

有谁知道拉斐尔是否支持使用投影.我正在尝试为我创建的对象创建一个投影.这是我的代码,但我无法弄清楚如何添加投影.如果你的经理对我变得非常沮丧,请帮助我.

<html>
<head><title></title>
<script src="raphael-min.js"></script>
<script src="jquery-1.7.2.js"></script>
</head>

<body>

<div id="draw-here-raphael" style="height: 200px; width: 400px;">
</div>

<script type="text/javascript">
//all your javascript goes here

var r = new Raphael("draw-here-raphael"),

    // Store where the box is
    position = 'left',

    // Make our pink rectangle
    rect = r.rect(20, 20, 50, 50).attr({"fill": "#fbb"});

</script>

</body>
</html>
Run Code Online (Sandbox Code Playgroud)

Sup*_*upr 7

.glow()-method可以用来在一定程度上:

var circle = paper.circle(100,100,50);
var path = paper.path('m200,50 l100,0 l100,100 l0,100 z');

circle.glow();

path.attr({
    fill: 'blue'
});
path.glow({
    color: '#444',
    offsety: 20 
});?
Run Code Online (Sandbox Code Playgroud)

在这里看到它:http://jsfiddle.net/sveinatle/gkayG/7/

它似乎只适用于线条,它实际上并没有填补阴影.

  • 好吧,只需设置填充属性(无论什么价值,无关紧要,任何不是虚假的东西)和你的发光() - 产生的阴影填充 - http://jsfiddle.net/sveinatle/gkayG/3 / (2认同)