1

我有一个网络应用程序,它每 5 秒动态更新一次 HTML。当我对 svg 文件使用过滤器时,它在电视浏览器中不起作用,但在 PC 上工作正常

我的功能:

function addEfect(el_id, ef_id, opasite) {

    if (typeof(opasite) === 'undefined') {
        opasite = 1;
    }

    d3.select('#' + el_id).attr('filter','url(#' + ef_id + ')');
    d3.select('#' + el_id).style('opacity', opasite);
}

包含在 index.html 中

   <script language='javascript' src='<?php echo base_url();?         >javascripts/d3.js'></script>
   <script language='javascript' src='<?php echo base_url();?>javascripts/jquery-ui.js'></script>
   <link rel='stylesheet' type='text/css' href='<?php echo base_url();?>css/page.css'>

任何人请帮助我,谁知道我做错了什么!

例如隐藏过滤器:

    var h_filter = svg.select('defs')
   .append('filter')            .attr('id','h_filter')
   .append('feComponentTransfer');

   h_filter.append('feFuncR')
   .attr('type','identity');

   h_filter.append('feFuncG')
   .attr('type','identity');

   h_filter.append('feFuncB')
   .attr('type','identity');

   h_filter.append('feFuncA')
   .attr('type','linear')
   .attr('slope','0')
   .attr('intercept','0');

在浏览器中 FireFox 工作正常

4

0 回答 0