私は svg-pan-zoom ライブラリ ( https://github.com/ariutta/svg-pan-zoom ) を使用しており、私のサイトのページで約 75% の時間で動作します (最新の Chrome と Firefox の両方で)バージョン)。
これは私の側の設定ミスによるものだと想定しているので、エラーを起こしたのか、それともこれを引き起こしている可能性のある特定のシナリオがあるのか 疑問に思っていました.
私のコード:
(function (mw, $) {
$(document).ready(function () {
panZoomInstance = svgPanZoom('#stylometricanalysis-svg1', {
zoomEnabled: true,
controlIconsEnabled: true,
fit: true,
center: true,
minZoom: 0.1
});
panZoomInstance = svgPanZoom('#stylometricanalysis-svg2', {
zoomEnabled: true,
controlIconsEnabled: true,
fit: true,
center: true,
minZoom: 0.1
});
});
}(mediaWiki, jQuery));
エラー:
145 TypeError: this.options.svg.createSVGMatrix is not a function
ライブラリのバージョン: 3.2.9
<object class='stylometricanalysis-image' id='stylometricanalysis-svg1' type='image/svg+xml' data='/some/path/to/svg/file.svg'>Your browser does not support SVG files, and so your visualization cannot display</object>
<object class='stylometricanalysis-image' id='stylometricanalysis-svg2' type='image/svg+xml' data='/some/path/to/svg/file.svg'>Your browser does not support SVG files, and so your visualization cannot display</object>