我在项目中使用了动态生成的SVG元素。我们会动态更改SVG模式图像,同时还会复制SVG元素。
在所有浏览器中,除了Safari之外,一切都很好。在Safari SVG元素中,SVG元素更改后无法正确呈现。
我的完整代码如下
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>SVG background change</title>
<script src="https://curtainsstyle.com/assets/template/js/jquery.min.js"></script>
<style>#forCopy, #copied { width: 48%; float: left; }</style>
</head>
<body>
<div class="drapes-svg">
<div id="forCopy">
<svg filter="url(#filtergAbCdEfGh)" preserveAspectRatio="none" version="1.1" width="400" height="1069.042316258352" viewBox="0 0 400 1069.042316258352" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<pattern id="patterngAbCdEfGh" x="0" y="0" width="350" height="350" patternUnits="userSpaceOnUse" patternTransform="scale(0.4 0.7)">
<image width="350" height="350" xlink:href="fabric-default.jpg"></image>
</pattern>
<filter id="filtergAbCdEfGh" x="-25%" y="0%" width="200%" height="200%">
<feGaussianBlur in="SourceAlpha" stdDeviation="7"></feGaussianBlur>
<feOffset dx="2" dy="2"></feOffset>
<feComponentTransfer>
<feFuncA type="linear" slope="0.5"></feFuncA>
</feComponentTransfer>
<feMerge>
<feMergeNode></feMergeNode>
<feMergeNode in="SourceGraphic"></feMergeNode>
</feMerge>
</filter>
</defs>
<g>
<path fill="url(#patterngAbCdEfGh)" d="M36.972 0.891 C 36.971 1.136,36.243 1.336,35.353 1.336 C 34.236 1.336,33.459 1.647,32.843 2.339 C 32.238 3.018,31.887 3.162,31.751 2.784 C 31.642 2.478,30.967 2.227,30.252 2.227 C 29.538 2.227,28.953 2.027,28.953 1.782 C 28.953 1.537,28.552 1.336,28.062 1.336 C 27.572 1.336,27.171 1.537,27.171 1.782 C 27.171 2.027,26.614 2.227,25.934 2.227 C 25.207 2.227,24.431 2.595,24.053 3.118 C 23.480 3.914,22.900 4.009,18.610 4.009 C 15.706 4.009,13.808 4.185,13.808 4.454 C 13.808 4.699,13.224 4.900,12.509 4.900 C 11.795 4.900,11.093 5.150,10.950 5.457 C 10.742 5.902,10.638 5.902,10.431 5.457 C 10.288 5.150,9.787 4.900,9.317 4.900 C 8.847 4.900,8.463 4.699,8.463 4.454 C 8.463 4.209,7.661 4.009,6.682 4.009 C 5.702 4.009,4.900 4.209,4.900 4.454 C 4.900 4.699,4.585 4.900,4.200 4.900 C 2.303 4.900,2.227 5.486,2.227 20.235 C 2.227 29.314,2.385 34.298,2.673 34.298 C 2.948 34.298,3.118 36.674,3.118 40.535 C 3.118 44.395,3.288 46.771,3.563 46.771 C 3.808 46.771,4.009 47.171,4.009 47.661 C 4.009 48.151,3.808 48.552,3.563 48.552 C 3.285 48.552,3.118 51.225,3.118 55.679 C 3.118 60.134,2.951 62.806,2.673 62.806 C 2.378 62.806,2.227 81.960,2.227 119.376 C 2.227 156.793,2.076 175.947,1.782 175.947 C 1.486 175.947,1.336 203.997,1.336 259.206 C 1.336 309.868,1.175 342.523,0.924 342.613 C 0.671 342.704,0.468 482.457,0.399 702.716 L 0.286 1062.670 2.358 1064.743 C 3.498 1065.882,4.663 1066.815,4.947 1066.815 C 5.231 1066.815,5.854 1067.266,6.332 1067.817 C 7.377 1069.022,33.793 1069.444,34.187 1068.263 C 34.289 1067.957,34.666 1067.706,35.024 1067.706 C 36.075 1067.706,37.862 1065.616,37.862 1064.386 C 37.862 1063.762,38.062 1063.252,38.307 1063.252 C 38.552 1063.252,38.753 1062.937,38.753 1062.552 C 38.753 1061.651,39.825 1060.579,40.725 1060.579 C 41.110 1060.579,41.425 1060.379,41.425 1060.134 C 41.425 1059.889,41.826 1059.688,42.316 1059.688 C 42.806 1059.688,43.207 1059.488,43.207 1059.243 C 43.207 1058.998,43.608 1058.797,44.098 1058.797 C 44.588 1058.797,44.989 1058.998,44.989 1059.243 C 44.989 1059.488,45.503 1059.688,46.131 1059.688 C 46.916 1059.688,47.953 1060.385,49.443 1061.915 C 50.636 1063.140,51.882 1064.143,52.211 1064.143 C 52.541 1064.143,53.099 1064.543,53.452 1065.033 C 53.805 1065.523,54.451 1065.924,54.887 1065.924 C 55.323 1065.924,55.679 1066.125,55.679 1066.370 C 55.679 1066.615,56.281 1066.815,57.016 1066.815 C 57.751 1066.815,58.352 1067.016,58.352 1067.261 C 58.352 1067.506,58.753 1067.706,59.243 1067.706 C 59.733 1067.706,60.134 1067.906,60.134 1068.151 C 60.134 1068.434,63.549 1068.597,69.488 1068.597 C 75.427 1068.597,78.842 1068.434,78.842 1068.151 C 78.842 1067.906,79.443 1067.706,80.178 1067.706 C 80.913 1067.706,81.514 1067.506,81.514 1067.261 C 81.514 1067.016,81.871 1066.815,82.307 1066.815 C 82.743 1066.815,83.388 1066.414,83.742 1065.924 C 84.095 1065.434,84.654 1065.033,84.985 1065.033 C 85.801 1065.033,86.860 1063.919,86.860 1063.061 C 86.860 1062.676,87.060 1062.361,87.305 1062.361 C 87.550 1062.361,87.751 1061.804,87.751 1061.123 C 87.751 1060.396,88.118 1059.620,88.641 1059.243 C 89.131 1058.890,89.532 1058.330,89.532 1057.999 C 89.532 1057.183,90.646 1056.125,91.505 1056.125 C 91.890 1056.125,92.205 1055.924,92.205 1055.679 C 92.205 1055.434,92.606 1055.234,93.096 1055.234 C 93.586 1055.234,93.987 1055.434,93.987 1055.679 C 93.987 1055.924,94.494 1056.125,95.115 1056.125 C 96.313 1056.125,99.332 1058.754,99.332 1059.798 C 99.332 1060.119,99.733 1060.671,100.223 1061.024 C 100.713 1061.378,101.114 1061.937,101.114 1062.268 C 101.114 1063.084,102.228 1064.143,103.086 1064.143 C 103.471 1064.143,103.786 1064.343,103.786 1064.588 C 103.786 1064.833,104.187 1065.033,104.677 1065.033 C 105.167 1065.033,105.568 1065.234,105.568 1065.479 C 105.568 1065.724,105.969 1065.924,106.459 1065.924 C 106.949 1065.924,107.350 1066.125,107.350 1066.370 C 107.350 1066.615,107.951 1066.815,108.686 1066.815 C 109.421 1066.815,110.022 1067.016,110.022 1067.261 C 110.022 1067.506,110.807 1067.706,111.767 1067.706 C 112.767 1067.706,113.591 1067.944,113.697 1068.263 C 113.839 1068.690,116.713 1068.820,126.057 1068.820 C 135.401 1068.820,138.275 1068.690,138.418 1068.263 C 138.521 1067.957,138.988 1067.706,139.458 1067.706 C 139.928 1067.706,140.312 1067.506,140.312 1067.261 C 140.312 1067.016,140.713 1066.815,141.203 1066.815 C 141.693 1066.815,142.094 1066.615,142.094 1066.370 C 142.094 1066.125,142.401 1065.924,142.777 1065.924 C 143.663 1065.924,146.548 1063.040,146.548 1062.153 C 146.548 1061.777,146.748 1061.470,146.993 1061.470 C 147.238 1061.470,147.439 1061.069,147.439 1060.579 C 147.439 1060.089,147.639 1059.688,147.884 1059.688 C 148.129 1059.688,148.330 1059.373,148.330 1058.988 C 148.330 1055.020,152.517 1056.270,158.129 1061.915 C 160.808 1064.610,163.308 1066.815,163.683 1066.815 C 164.058 1066.815,164.365 1067.016,164.365 1067.261 C 164.365 1067.506,164.749 1067.706,165.219 1067.706 C 165.689 1067.706,166.156 1067.957,166.258 1068.263 C 166.401 1068.691,169.333 1068.820,178.910 1068.820 C 192.141 1068.820,192.873 1068.704,192.873 1066.624 C 192.873 1066.239,193.073 1065.924,193.318 1065.924 C 193.563 1065.924,193.764 1065.523,193.764 1065.033 C 193.764 1064.543,193.964 1064.143,194.209 1064.143 C 194.454 1064.143,194.655 1063.742,194.655 1063.252 C 194.655 1062.762,194.855 1062.361,195.100 1062.361 C 195.345 1062.361,195.546 1062.046,195.546 1061.661 C 195.546 1060.609,196.675 1059.688,197.964 1059.688 C 198.594 1059.688,199.109 1059.488,199.109 1059.243 C 199.109 1058.998,199.510 1058.797,200.000 1058.797 C 200.490 1058.797,200.891 1058.998,200.891 1059.243 C 200.891 1059.488,201.406 1059.688,202.036 1059.688 C 203.325 1059.688,204.454 1060.609,204.454 1061.661 C 204.454 1062.046,204.655 1062.361,204.900 1062.361 C 205.145 1062.361,205.345 1062.762,205.345 1063.252 C 205.345 1063.742,205.546 1064.143,205.791 1064.143 C 206.036 1064.143,206.236 1064.543,206.236 1065.033 C 206.236 1065.523,206.437 1065.924,206.682 1065.924 C 206.927 1065.924,207.127 1066.239,207.127 1066.624 C 207.127 1068.704,207.859 1068.820,221.090 1068.820 C 230.667 1068.820,233.599 1068.691,233.742 1068.263 C 233.844 1067.957,234.311 1067.706,234.781 1067.706 C 235.251 1067.706,235.635 1067.506,235.635 1067.261 C 235.635 1067.016,235.942 1066.815,236.317 1066.815 C 236.692 1066.815,239.192 1064.610,241.871 1061.915 C 247.483 1056.270,251.670 1055.020,251.670 1058.988 C 251.670 1059.373,251.871 1059.688,252.116 1059.688 C 252.361 1059.688,252.561 1060.089,252.561 1060.579 C 252.561 1061.069,252.762 1061.470,253.007 1061.470 C 253.252 1061.470,253.452 1061.777,253.452 1062.153 C 253.452 1063.040,256.337 1065.924,257.223 1065.924 C 257.599 1065.924,257.906 1066.125,257.906 1066.370 C 257.906 1066.615,258.307 1066.815,258.797 1066.815 C 259.287 1066.815,259.688 1067.016,259.688 1067.261 C 259.688 1067.506,260.072 1067.706,260.542 1067.706 C 261.012 1067.706,261.479 1067.957,261.582 1068.263 C 261.725 1068.690,264.599 1068.820,273.943 1068.820 C 283.287 1068.820,286.161 1068.690,286.303 1068.263 C 286.409 1067.944,287.233 1067.706,288.233 1067.706 C 289.193 1067.706,289.978 1067.506,289.978 1067.261 C 289.978 1067.016,290.579 1066.815,291.314 1066.815 C 292.049 1066.815,292.650 1066.615,292.650 1066.370 C 292.650 1066.125,293.051 1065.924,293.541 1065.924 C 294.031 1065.924,294.432 1065.724,294.432 1065.479 C 294.432 1065.234,294.833 1065.033,295.323 1065.033 C 295.813 1065.033,296.214 1064.833,296.214 1064.588 C 296.214 1064.343,296.529 1064.143,296.914 1064.143 C 297.772 1064.143,298.886 1063.084,298.886 1062.268 C 298.886 1061.937,299.287 1061.378,299.777 1061.024 C 300.267 1060.671,300.668 1060.119,300.668 1059.798 C 300.668 1058.754,303.687 1056.125,304.885 1056.125 C 305.506 1056.125,306.013 1055.924,306.013 1055.679 C 306.013 1055.434,306.414 1055.234,306.904 1055.234 C 307.394 1055.234,307.795 1055.434,307.795 1055.679 C 307.795 1055.924,308.110 1056.125,308.495 1056.125 C 309.354 1056.125,310.468 1057.183,310.468 1057.999 C 310.468 1058.330,310.869 1058.890,311.359 1059.243 C 311.882 1059.620,312.249 1060.396,312.249 1061.123 C 312.249 1061.804,312.450 1062.361,312.695 1062.361 C 312.940 1062.361,313.140 1062.676,313.140 1063.061 C 313.140 1063.919,314.199 1065.033,315.015 1065.033 C 315.346 1065.033,315.905 1065.434,316.258 1065.924 C 316.612 1066.414,317.257 1066.815,317.693 1066.815 C 318.129 1066.815,318.486 1067.016,318.486 1067.261 C 318.486 1067.506,319.087 1067.706,319.822 1067.706 C 320.557 1067.706,321.158 1067.906,321.158 1068.151 C 321.158 1068.434,324.573 1068.597,330.512 1068.597 C 336.451 1068.597,339.866 1068.434,339.866 1068.151 C 339.866 1067.906,340.267 1067.706,340.757 1067.706 C 341.247 1067.706,341.648 1067.506,341.648 1067.261 C 341.648 1067.016,342.249 1066.815,342.984 1066.815 C 343.719 1066.815,344.321 1066.615,344.321 1066.370 C 344.321 1066.125,344.677 1065.924,345.113 1065.924 C 345.549 1065.924,346.195 1065.523,346.548 1065.033 C 346.901 1064.543,347.459 1064.143,347.789 1064.143 C 348.118 1064.143,349.364 1063.140,350.557 1061.915 C 352.047 1060.385,353.084 1059.688,353.869 1059.688 C 354.497 1059.688,355.011 1059.488,355.011 1059.243 C 355.011 1058.998,355.412 1058.797,355.902 1058.797 C 356.392 1058.797,356.793 1058.998,356.793 1059.243 C 356.793 1059.488,357.194 1059.688,357.684 1059.688 C 358.174 1059.688,358.575 1059.889,358.575 1060.134 C 358.575 1060.379,358.890 1060.579,359.275 1060.579 C 360.175 1060.579,361.247 1061.651,361.247 1062.552 C 361.247 1062.937,361.448 1063.252,361.693 1063.252 C 361.938 1063.252,362.138 1063.762,362.138 1064.386 C 362.138 1065.616,363.925 1067.706,364.976 1067.706 C 365.334 1067.706,365.711 1067.957,365.813 1068.263 C 366.207 1069.444,392.623 1069.022,393.668 1067.817 C 394.146 1067.266,394.769 1066.815,395.053 1066.815 C 395.337 1066.815,396.502 1065.882,397.642 1064.743 L 399.714 1062.670 399.601 702.716 C 399.532 482.457,399.329 342.704,399.076 342.613 C 398.825 342.523,398.664 309.868,398.664 259.206 C 398.664 203.997,398.514 175.947,398.218 175.947 C 397.924 175.947,397.773 156.793,397.773 119.376 C 397.773 81.960,397.622 62.806,397.327 62.806 C 397.049 62.806,396.882 60.134,396.882 55.679 C 396.882 51.225,396.715 48.552,396.437 48.552 C 396.192 48.552,395.991 48.151,395.991 47.661 C 395.991 47.171,396.192 46.771,396.437 46.771 C 396.712 46.771,396.882 44.395,396.882 40.535 C 396.882 36.674,397.052 34.298,397.327 34.298 C 397.615 34.298,397.773 29.314,397.773 20.235 C 397.773 5.486,397.697 4.900,395.800 4.900 C 395.415 4.900,395.100 4.699,395.100 4.454 C 395.100 4.209,394.298 4.009,393.318 4.009 C 392.339 4.009,391.537 4.209,391.537 4.454 C 391.537 4.699,391.153 4.900,390.683 4.900 C 390.213 4.900,389.712 5.150,389.569 5.457 C 389.362 5.902,389.258 5.902,389.050 5.457 C 388.907 5.150,388.205 4.900,387.491 4.900 C 386.776 4.900,386.192 4.699,386.192 4.454 C 386.192 4.185,384.294 4.009,381.390 4.009 C 377.100 4.009,376.520 3.914,375.947 3.118 C 375.569 2.595,374.793 2.227,374.066 2.227 C 373.386 2.227,372.829 2.027,372.829 1.782 C 372.829 1.537,372.428 1.336,371.938 1.336 C 371.448 1.336,371.047 1.537,371.047 1.782 C 371.047 2.027,370.462 2.227,369.748 2.227 C 369.033 2.227,368.358 2.478,368.249 2.784 C 368.113 3.162,367.762 3.018,367.157 2.339 C 366.541 1.647,365.764 1.336,364.647 1.336 C 363.757 1.336,363.029 1.136,363.029 0.891 C 363.029 0.643,361.841 0.445,360.356 0.445 C 357.981 0.445,357.684 0.544,357.684 1.336 C 357.684 2.168,357.387 2.227,353.229 2.227 C 350.557 2.227,348.775 2.049,348.775 1.782 C 348.775 1.537,347.773 1.336,346.548 1.336 C 345.323 1.336,344.321 1.537,344.321 1.782 C 344.321 2.027,343.404 2.227,342.284 2.227 C 340.182 2.227,338.976 2.947,338.976 4.200 C 338.976 4.719,338.517 4.900,337.194 4.900 C 336.214 4.900,335.412 4.699,335.412 4.454 C 335.412 4.185,333.515 4.009,330.611 4.009 C 326.320 4.009,325.741 3.914,325.167 3.118 C 324.790 2.595,324.014 2.227,323.287 2.227 C 322.606 2.227,322.049 2.027,322.049 1.782 C 322.049 1.537,321.648 1.336,321.158 1.336 C 320.668 1.336,320.267 1.537,320.267 1.782 C 320.267 2.027,319.683 2.227,318.968 2.227 C 318.254 2.227,317.579 2.478,317.469 2.784 C 317.333 3.162,316.982 3.018,316.377 2.339 C 315.762 1.647,314.984 1.336,313.868 1.336 C 312.978 1.336,312.249 1.136,312.249 0.891 C 312.249 -0.021,307.154 0.371,306.459 1.336 C 305.911 2.096,305.306 2.227,302.352 2.227 C 300.338 2.227,298.886 2.414,298.886 2.673 C 298.886 2.918,298.686 3.118,298.441 3.118 C 298.196 3.118,297.996 2.717,297.996 2.227 C 297.996 1.455,297.699 1.336,295.768 1.336 C 294.543 1.336,293.541 1.537,293.541 1.782 C 293.541 2.029,292.353 2.227,290.869 2.227 C 288.736 2.227,288.196 2.369,288.196 2.927 C 288.196 3.312,287.910 3.913,287.560 4.263 C 286.836 4.987,284.633 5.130,284.633 4.454 C 284.633 4.185,282.735 4.009,279.831 4.009 C 275.541 4.009,274.961 3.914,274.388 3.118 C 274.010 2.595,273.234 2.227,272.507 2.227 C 271.827 2.227,271.269 2.027,271.269 1.782 C 271.269 1.537,270.668 1.336,269.933 1.336 C 269.198 1.336,268.597 1.537,268.597 1.782 C 268.597 2.027,268.213 2.227,267.743 2.227 C 267.274 2.227,266.799 2.478,266.690 2.784 C 266.554 3.162,266.203 3.018,265.598 2.339 C 264.982 1.647,264.205 1.336,263.088 1.336 C 262.198 1.336,261.470 1.136,261.470 0.891 C 261.470 0.636,260.134 0.445,258.352 0.445 C 255.531 0.445,255.234 0.530,255.234 1.336 C 255.234 2.152,254.937 2.227,251.707 2.227 C 249.290 2.227,248.118 2.402,247.981 2.784 C 247.846 3.162,247.495 3.018,246.890 2.339 C 245.954 1.287,241.871 0.834,241.871 1.782 C 241.871 2.027,240.955 2.227,239.835 2.227 C 237.522 2.227,236.526 2.955,236.526 4.645 C 236.526 5.275,236.325 5.791,236.080 5.791 C 235.835 5.791,235.635 5.590,235.635 5.345 C 235.635 5.100,235.033 4.900,234.298 4.900 C 233.563 4.900,232.962 4.699,232.962 4.454 C 232.962 4.185,231.065 4.009,228.161 4.009 C 223.870 4.009,223.291 3.914,222.717 3.118 C 222.364 2.628,221.718 2.227,221.283 2.227 C 220.847 2.227,220.490 2.027,220.490 1.782 C 220.490 1.537,219.889 1.336,219.154 1.336 C 218.419 1.336,217.817 1.537,217.817 1.782 C 217.817 2.027,217.416 2.227,216.927 2.227 C 216.437 2.227,216.036 2.428,216.036 2.673 C 216.036 3.460,214.472 3.147,213.808 2.227 C 213.361 1.607,212.655 1.336,211.483 1.336 C 210.557 1.336,209.800 1.136,209.800 0.891 C 209.800 0.643,208.612 0.445,207.127 0.445 C 204.751 0.445,204.454 0.544,204.454 1.336 C 204.454 2.029,204.157 2.227,203.118 2.227 C 202.383 2.227,201.782 2.027,201.782 1.782 C 201.782 1.537,200.980 1.336,200.000 1.336 C 199.020 1.336,198.218 1.537,198.218 1.782 C 198.218 2.027,197.617 2.227,196.882 2.227 C 195.843 2.227,195.546 2.029,195.546 1.336 C 195.546 0.544,195.249 0.445,192.873 0.445 C 191.388 0.445,190.200 0.643,190.200 0.891 C 190.200 1.136,189.443 1.336,188.517 1.336 C 187.345 1.336,186.639 1.607,186.192 2.227 C 185.528 3.147,183.964 3.460,183.964 2.673 C 183.964 2.428,183.563 2.227,183.073 2.227 C 182.584 2.227,182.183 2.027,182.183 1.782 C 182.183 1.537,181.581 1.336,180.846 1.336 C 180.111 1.336,179.510 1.537,179.510 1.782 C 179.510 2.027,179.153 2.227,178.717 2.227 C 178.282 2.227,177.636 2.628,177.283 3.118 C 176.709 3.914,176.130 4.009,171.839 4.009 C 168.935 4.009,167.038 4.185,167.038 4.454 C 167.038 4.699,166.437 4.900,165.702 4.900 C 164.967 4.900,164.365 5.100,164.365 5.345 C 164.365 5.590,164.165 5.791,163.920 5.791 C 163.675 5.791,163.474 5.275,163.474 4.645 C 163.474 2.955,162.478 2.227,160.165 2.227 C 159.045 2.227,158.129 2.027,158.129 1.782 C 158.129 0.834,154.046 1.287,153.110 2.339 C 152.505 3.018,152.154 3.162,152.019 2.784 C 151.882 2.402,150.710 2.227,148.293 2.227 C 145.063 2.227,144.766 2.152,144.766 1.336 C 144.766 0.530,144.469 0.445,141.648 0.445 C 139.866 0.445,138.530 0.636,138.530 0.891 C 138.530 1.136,137.802 1.336,136.912 1.336 C 135.795 1.336,135.018 1.647,134.402 2.339 C 133.797 3.018,133.446 3.162,133.310 2.784 C 133.201 2.478,132.726 2.227,132.257 2.227 C 131.787 2.227,131.403 2.027,131.403 1.782 C 131.403 1.537,130.802 1.336,130.067 1.336 C 129.332 1.336,128.731 1.537,128.731 1.782 C 128.731 2.027,128.173 2.227,127.493 2.227 C 126.766 2.227,125.990 2.595,125.612 3.118 C 125.039 3.914,124.459 4.009,120.169 4.009 C 117.265 4.009,115.367 4.185,115.367 4.454 C 115.367 5.130,113.164 4.987,112.440 4.263 C 112.090 3.913,111.804 3.312,111.804 2.927 C 111.804 2.369,111.264 2.227,109.131 2.227 C 107.647 2.227,106.459 2.029,106.459 1.782 C 106.459 1.537,105.457 1.336,104.232 1.336 C 102.301 1.336,102.004 1.455,102.004 2.227 C 102.004 2.717,101.804 3.118,101.559 3.118 C 101.314 3.118,101.114 2.918,101.114 2.673 C 101.114 2.414,99.662 2.227,97.648 2.227 C 94.694 2.227,94.089 2.096,93.541 1.336 C 92.846 0.371,87.751 -0.021,87.751 0.891 C 87.751 1.136,87.022 1.336,86.132 1.336 C 85.016 1.336,84.238 1.647,83.623 2.339 C 83.018 3.018,82.667 3.162,82.531 2.784 C 82.421 2.478,81.746 2.227,81.032 2.227 C 80.317 2.227,79.733 2.027,79.733 1.782 C 79.733 1.537,79.332 1.336,78.842 1.336 C 78.352 1.336,77.951 1.537,77.951 1.782 C 77.951 2.027,77.394 2.227,76.713 2.227 C 75.986 2.227,75.210 2.595,74.833 3.118 C 74.259 3.914,73.680 4.009,69.389 4.009 C 66.485 4.009,64.588 4.185,64.588 4.454 C 64.588 4.699,63.786 4.900,62.806 4.900 C 61.483 4.900,61.024 4.719,61.024 4.200 C 61.024 2.947,59.818 2.227,57.716 2.227 C 56.596 2.227,55.679 2.027,55.679 1.782 C 55.679 1.537,54.677 1.336,53.452 1.336 C 52.227 1.336,51.225 1.537,51.225 1.782 C 51.225 2.049,49.443 2.227,46.771 2.227 C 42.613 2.227,42.316 2.168,42.316 1.336 C 42.316 0.544,42.019 0.445,39.644 0.445 C 38.159 0.445,36.971 0.643,36.971 0.891 " stroke="none" fill-rule="evenodd"></path>
</g>
</svg>
</div>
<div id="copied"></div>
<button style="position: fixed; z-index: 999999999; top: 0; left: 0" id="copy">Copy</button>
</div>
<script>
$(document).ready(function() {
$('#copy').click(function() {
var copiedSvg = $('#forCopy').clone().html();
copiedSvg = copiedSvg.replace(/AbCdEfGh/g, 'AbCdEfGh-replaced');
copiedSvg = copiedSvg.replace('fabric-default.jpg', 'fabric-pattern.jpg');
$('#copied').html(copiedSvg);
});
});
</script>
</body>
</html>
在SVG元素更改后(例如,在更改svg defs模式图像href之后),Safari如何正确呈现SVG?
预期结果将在Chrome,Mozilla中显示,但在Safari中显示-不会。预览here
问题可能出在哪里?为什么Safari更改后无法正确显示SVG?
答案 0 :(得分:0)
将过滤器移动到元素可以解决此问题。另外,添加overflow =“ visible”以确保不删除过滤器。