我正在創(chuàng)建 2 個(gè)狀態(tài) svg 驅(qū)動(dòng)的動(dòng)畫圖標(biāo),我使用了圖標(biāo)轉(zhuǎn)換生成器網(wǎng)站名稱 nucleoapp 我上傳了兩個(gè) svg 圖標(biāo),當(dāng)我在 html 中包含完整代碼時(shí),它們給了我代碼,它運(yùn)行良好,但是當(dāng)我刪除腳本標(biāo)簽并剪切 javascript 代碼并粘貼時(shí)我的 javascript 文件它給了我這個(gè)錯(cuò)誤 Uncaught SyntaxError: Unexpected token ';'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" height="512" width="512"> <g class="nc-icon-wrapper js-transition-icon" data-effect="scale" data-event="click"> <g class="js-transition-icon__state" style=""> <path d="M368.5 240H272v-96.5c0-8.8-7.2-16-16-16s-16 7.2-16 16V240h-96.5c-8.8 0-16 7.2-16 16 0 4.4 1.8 8.4 4.7 11.3 2.9 2.9 6.9 4.7 11.3 4.7H240v96.5c0 4.4 1.8 8.4 4.7 11.3 2.9 2.9 6.9 4.7 11.3 4.7 8.8 0 16-7.2 16-16V272h96.5c8.8 0 16-7.2 16-16s-7.2-16-16-16z"></path> </g> <g class="js-transition-icon__state" aria-hidden="true" style="display: none;"> <path d="M368.5 240h-225c-8.8 0-16 7.2-16 16 0 4.4 1.8 8.4 4.7 11.3 2.9 2.9 6.9 4.7 11.3 4.7h225c8.8 0 16-7.2 16-16s-7.2-16-16-16z"></path> </g> </g> <script> ! function() { "use strict"; if (!window.requestAnimationFrame) { var a = null; window.requestAnimationFrame = function(t, i) { var e = (new Date).getTime(); a || (a = e); var s = Math.max(0, 16 - (e - a)), n = window.setTimeout(function() { t(e + s) }, s); return a = e + s, n } } function r(t, i, e, s) { return 1 & gt; (t /= s / 2) ? e / 2 * t * t * t * t + i: -e / 2 * ((t -= 2) * t * t * t - 2) + i } function e(t) { return t ? [1, 0] : [0, 1] } function t(t) { this.element = t, this.svg = function t(i) { var e = i.parentNode; if ("svg" !== e.tagName) e = t(e); return e;
我正在創(chuàng)建 2 個(gè)狀態(tài) svg 驅(qū)動(dòng)的動(dòng)畫圖標(biāo),但出現(xiàn)錯(cuò)誤
胡子哥哥
2021-12-02 16:48:05