小编use*_*121的帖子

SVG动画不能在IE9/IE10上运行

嗨我有一段HTML基本上做SVG动画的代码.这适用于Chrome和Firefox,但不适用于IE9/IE10.

有解决方案吗

需要单个代码库,至少在Chrome/Firefox/IE 9及更高版本中有效.

<!DOCTYPE html>  
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
</head>

<body>

    <div id='svgnotsupported' style='visibility: hidden;'>
        <h1>This application requires SVG support</h1>
    </div>

    <div id='svgsupported' style='visibility: hidden'></div>

    <script>

        var svgsupport;

        window.onload = function supportsSvg() {

            var ua = navigator.userAgent;
            var M = ua.match(/(chrome)\/?\s*(\.?\d+(\.\d+)*)/i);
            var b =   document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure",  "1.0")
            if(b || M) {
                svgsupport = document.getElementById('svgsupported');
            } else {
                svgsupport = document.getElementById('svgnotsupported');
            }

            svgsupport.style.visibility = 'visible';

        }

    </script>

    <svg id="no_fewer_than_N_events_E_between_event_Q_and_first_R_thereafter" width="588" height="578" version="1.1" xmlns="http://www.w3.org/2000/svg">
        <defs>
            <marker id="Triangle" viewBox="0 …
Run Code Online (Sandbox Code Playgroud)

animation internet-explorer svg

10
推荐指数
1
解决办法
2万
查看次数

标签 统计

animation ×1

internet-explorer ×1

svg ×1