我編寫了一個web應用程序,在這個圖像中有一些標記,我將它設置爲none。像示例代碼一樣。我的問題是,當我在一些設備上運行圖像無法加載。當我設置圖像只顯示空白顯示。設置顯示時不顯示SVG圖像無
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<svg>
<g id="gimg">
<image id="img" display="none" xlink:href="https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png" x="0" y="0" height="50px" width="50px"/>
</g>
<rect id="myrect" x="100" y="100" width="20" height="20"></rect>
</svg>
<script>
$("#myrect").on("click",function(){
$("#img").show();
});
</script>
在PC中,而不是在手機? –
它不適合我。 jQuery能否訪問svg元素中的shadow dom?我認爲它沒有。 – somethinghere
適用於FF,Chrome,Edge,IE11 – LGSon