简体   繁体   English

Internet Explorer jQuery + SVG

[英]Internet explorer jquery + SVG

i have a little script on jQuery that is suposed to get the value of certain SVG element and store it on a hidden input. 我在jQuery上有一个小脚本,用于获取某些SVG元素的值并将其存储在隐藏的输入中。 Finally, it adds a class that changes the SVG element opacity. 最后,它添加了一个更改SVG元素不透明度的类。

The problem is that it doesn't work at all on IExplore (no wonder). 问题在于它在IExplore上根本不起作用(难怪)。 Here's the script: 这是脚本:

    $(function() { 
        $("#diagnostic svg g").click(function(e){
            e.preventDefault();

            console.log($(this));

            $("#location").val($(this).attr("id"));


            $(this).parent().find("g").each(function(){
                $(this).removeAttr("active");
            });
            $(this).attr("active","active");
        });
    });

and the css definitions: 和CSS定义:

#diagnostico svg g { opacity: 0; }
#diagnostico svg g:hover,
#diagnostico svg g[active="active"] { opacity: 1; }

is there any way to fix it for IE? 有什么办法可以修复IE吗?

Thanks :-) 谢谢 :-)

Internet Explorer对console.log的支持最少

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM