【问题标题】:Raphael Fill Opacity on member.mouseover拉斐尔在 member.mouseover 上填充不透明度
【发布时间】:2013-10-31 21:26:41
【问题描述】:

我使用http://www.irunmywebsite.com/raphael/SVGTOHTML_LIVE90.php 生成了一个VML 文件。在 VML 文件中有一个回调函数部分,用于确定事件:

function callback(member)
{
   member.mouseover(function (e) {  this.ofill=this.attr('fill');this.attr({fill:'#000000'}); });
   member.mouseout(function (e) { this.attr({fill:this.ofill}); });
   member.click(function (e) { var thisPath=this.attr('path');alert('You just clicked on Element #'+this.id+'.To help you find it in the code its path starts with......'+thisPath);   });
}

如您所见,第一行用黑色填充了悬停在上方的 VML 形状。我想要做的是改变它的填充不透明度。

我试过了:

this.ofill=this.attr('fill');this.attr({fill-opacity:'#000000'});

和其他类似的变体没有成功。有什么想法我需要在这里做什么?

谢谢

【问题讨论】:

    标签: javascript raphael vml


    【解决方案1】:

    您需要不透明度而不是颜色的数字。

    可能是这样的:

    this.ofill=this.attr('fill-opacity');this.attr({'fill-opacity':0.5});
    

    【讨论】:

    • 这是我尝试的第一件事。不工作。我在想this.ofill 可能是罪魁祸首。
    • 可能会有另一个变量,除了不透明度的ofill
    【解决方案2】:

    显然,VML 没有填充不透明度。 IE8 用户只需要看到 VML 的纯色:P

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-04-15
      • 1970-01-01
      • 2011-05-01
      • 2012-11-24
      • 2017-03-24
      • 2023-03-28
      • 2011-08-27
      相关资源
      最近更新 更多