html+svg代码:
<aside class="evaluate-side btn" style="display:none;"> <div class="center"> <svg class="circle-line" viewBox="0 0 32 32"> <circle class="cake" r="16" cx="16" cy="16"></circle> <circle class="mask" r="12" cx="16" cy="16"> </circle> <text dx="16" dy="-17">作答率</text> <text dx="16" dy="-12"><tspan fill="#ffa836">..</tspan> / <tspan>..</tspan></text> </svg> <a class="button end" href="javascript:;">结束评测</a> </div> </aside>
ios8.4 webview中 svg标签没有children
sText = eBoxs[1].getElementsByTagName(‘text‘)[1].children; // undefined
解决:改成如下写法
sText = eBoxs[1].getElementsByTagName(‘text‘)[1].getElementsByTagName(‘tspan‘),
时间: 2024-10-08 10:15:02