SVG路径链接在Firefox和Safari上不起作用(但它们在Chrome上运行)

时间:2016-06-01 12:55:01

标签: xml svg hyperlink path

我最近发现svg路径中包含的链接已停止重定向到所需的地址。当我点击路径时,网站会刷新,但不会到达请求的位置。

以下是代码:

<svg class="carousel-indicators" version="1.1" id="strategie-grafik" x="0px" y="0px" width="368.555px" height="319.628px" viewBox="0 0 368.555 319.628" enable-background="new 0 0 368.555 319.628" xml:space="preserve">
            <path class="myCarousel-target" id="strategie-shop" data-slide-no="1" data-state="deactive" fill="#FFF" d="M174.016,2.946L92.314,144.46c-2.521,4.367-6.646,11.512-9.167,15.879L1.207,302.265
            c-2.521,4.365-0.96,5.967,3.468,3.559l65.484-35.621c4.43-2.408,10.115-7.953,12.637-12.318l40.908-70.855
            c2.521-4.365,6.645-11.51,9.166-15.877l41.146-71.27c2.521-4.367,4.584-12.064,4.584-17.105V4.173
            C178.6-0.868,176.538-1.421,174.016,2.946z M118.294,125.964c0.688-1.189,1.639-1.945,2.853-2.271
            c1.213-0.324,2.402-0.15,3.568,0.521c0.281,0.162,0.546,0.348,0.8,0.555l1.259,1.053l-11.105,19.234l-5.654-4.75L118.294,125.964z
            M100.704,156.433l5.455-9.445c0.686-1.189,1.637-1.947,2.851-2.271c1.212-0.326,2.404-0.15,3.569,0.521
            c0.279,0.162,0.546,0.348,0.8,0.555l1.258,1.053l-11.107,19.241l-1.259-1.053c-1.218-1.014-1.979-2.363-2.281-4.047
            C99.686,159.304,99.924,157.786,100.704,156.433z M96.868,163.08l5.635,4.783l-3.631,6.287l-5.633-4.783L96.868,163.08z
            M89.39,176.031l5.655,4.748l-3.631,6.287l-5.654-4.748L89.39,176.031z M78.036,207.009c-1.219-1.016-1.979-2.363-2.283-4.047
            c-0.301-1.684-0.064-3.201,0.719-4.555l8.279-14.342l5.637,4.781l-11.094,19.215L78.036,207.009z M100.77,204.789l-8.279,14.344
            l-5.648-4.756l7.477-12.953l-1.57-1.318l-4.648,8.049c-0.699,1.213-1.656,1.982-2.87,2.309c-1.215,0.324-2.405,0.15-3.569-0.521
            c-0.281-0.162-0.547-0.346-0.801-0.555l8.281-14.344c0.699-1.213,1.658-1.982,2.872-2.307c1.214-0.326,2.403-0.152,3.57,0.521
            c0.279,0.162,0.544,0.348,0.793,0.561l2.83,2.373c1.218,1.014,1.978,2.361,2.28,4.045
            C101.792,201.919,101.552,203.437,100.77,204.789z M112.084,185.193l-7.224-6.066l-3.847,6.664l7.223,6.066l-3.629,6.287
            l-11.625-9.758l11.11-19.24l11.622,9.758L112.084,185.193z M125.004,162.814l-5.451,9.445c-0.688,1.189-1.637,1.945-2.852,2.271
            c-1.213,0.324-2.402,0.15-3.569-0.521c-0.279-0.162-0.548-0.348-0.798-0.555l-7.255-6.018l3.649-6.322l5.977,5l3.828-6.633l-5.975-5
            l3.647-6.32l7.235,6.053c1.219,1.016,1.977,2.363,2.279,4.047C126.026,159.944,125.786,161.462,125.004,162.814z M128.862,156.132
            l-11.623-9.758l11.102-19.229c1.218,1.016,1.98,2.359,2.289,4.033s0.072,3.188-0.709,4.541l-4.652,8.059l7.225,6.066
            L128.862,156.132z"></path>
            <a href="https://www.sportbenzin.ch/shop/">
                <path class="myCarousel-surface" data-target="#strategieCarousel" data-state="deactive" data-slide-to="1" id="surface-shop" fill="transparent" d="M174.016,2.946L92.314,144.46c-2.521,4.367-6.646,11.512-9.167,15.879L1.207,302.265
                c-2.521,4.365-0.96,5.967,3.468,3.559l65.484-35.621c4.43-2.408,10.115-7.953,12.637-12.318l40.908-70.855
                c2.521-4.365,6.645-11.51,9.166-15.877l41.146-71.27c2.521-4.367,4.584-12.064,4.584-17.105V4.173
                C178.6-0.868,176.538-1.421,174.016,2.946z"></path>
            </a>
            <path class="myCarousel-target" id="strategie-blog" data-slide-no="2" data-state="deactive" fill="#FFF" d="M242.854,145.706l-4.256-7.373l1.928-0.701l4.26,7.375L242.854,145.706z
            M363.881,305.826l-65.484-35.623c-4.43-2.408-10.113-7.953-12.636-12.318l-40.907-70.855c-2.522-4.365-6.646-11.51-9.168-15.877
            l-41.146-71.27c-2.521-4.367-4.584-12.064-4.584-17.105V4.173c0-5.041,2.062-5.594,4.584-1.227l81.703,141.514
            c2.521,4.367,6.646,11.512,9.168,15.879l81.938,141.926C369.87,306.632,368.31,308.234,363.881,305.826z M267.827,169.566
            l11.107,19.24l1.539-0.564c0.307-0.113,0.6-0.252,0.881-0.414c1.166-0.674,1.91-1.617,2.236-2.83
            c0.325-1.215,0.145-2.416-0.542-3.605l-5.453-9.443c-0.782-1.354-1.978-2.32-3.584-2.898c-1.608-0.58-3.158-0.594-4.646-0.047
            L267.827,169.566z M263.68,147.847l-6.938,2.521l3.607,6.254l6.959-2.488L263.68,147.847z M244.221,128.681l11.507,19.932
            l1.541-0.562c0.306-0.115,0.601-0.254,0.88-0.414c1.165-0.674,1.91-1.617,2.236-2.83c0.324-1.215,0.144-2.418-0.542-3.607
            l-8.685-15.041L244.221,128.681z M240.298,152.507c1.609,0.578,3.157,0.594,4.646,0.047l3.471-1.258
            c0.129-0.045,0.251-0.1,0.37-0.168c0.606-0.35,1.116-1.08,1.533-2.189c1.527,0.547,2.688,0.67,3.479,0.369l-11.505-19.928
            l-14.263,5.188l8.684,15.043C237.495,150.962,238.69,151.929,240.298,152.507z M250.65,173.748l6.942-2.518l-6.473-11.209l7.304-2.7
            l-3.61-6.252l-14.26,5.186L250.65,173.748z M268.149,192.748l8.857-3.238l-3.649-6.32l-7.316,2.674l-3.829-6.633l7.317-2.674
            l-3.651-6.322l-8.838,3.273c-0.305,0.113-0.599,0.252-0.879,0.414c-1.166,0.674-1.91,1.617-2.236,2.832
            c-0.324,1.213-0.144,2.414,0.541,3.604l5.453,9.445c0.781,1.352,1.977,2.318,3.586,2.896
            C265.112,193.277,266.662,193.294,268.149,192.748z M289.129,210.505l-5.26-9.109l-5.385,1.986l1.619,2.803l-1.927,0.703
            l-3.851-6.67l7.318-2.676l-3.649-6.32l-8.837,3.273c-0.309,0.115-0.612,0.26-0.914,0.436c-1.143,0.658-1.877,1.596-2.202,2.811
            c-0.326,1.213-0.146,2.414,0.542,3.604l5.451,9.445c0.782,1.352,1.978,2.318,3.586,2.896c1.608,0.58,3.156,0.596,4.645,0.049
            L289.129,210.505z M297.993,207.279l-8.28-14.344c-0.78-1.352-1.976-2.318-3.586-2.896c-1.609-0.58-3.157-0.594-4.644-0.047
            l-1.541,0.562l11.094,19.215L297.993,207.279z"></path>
            <a href="https://www.sportbenzin.ch/blog/">
                <path class="myCarousel-surface" data-target="#strategieCarousel" data-state="deactive" data-slide-to="2" id="surface-blog" fill="transparent" d="M363.881,305.826l-65.484-35.623c-4.43-2.408-10.113-7.953-12.636-12.318l-40.907-70.855
                c-2.522-4.365-6.646-11.51-9.168-15.877l-41.146-71.27c-2.521-4.367-4.584-12.064-4.584-17.105V4.173
                c0-5.041,2.062-5.594,4.584-1.227l81.703,141.514c2.521,4.367,6.646,11.512,9.168,15.879l81.938,141.926
                C369.87,306.632,368.31,308.234,363.881,305.826z"></path>
            </a>
        </svg>

一开始,每个标签在href之前都有xlink:属性,当我删除它时,链接开始在Chrome中运行,但它们仍无法在Firefox和Safari中使用。

我在SVG中没有太多背景,你能不能给我一些关于它可能出错的提示?

提前致谢, Oktawia

0 个答案:

没有答案