首页 > 解决方案 > 如果无法加载,如何隐藏图像/视频

问题描述

如果无法在网站中加载,我希望能够隐藏 img/video

标签: javascripthtml

解决方案


您需要使用 javascript,用于视频。

x = document.getElementById("video");
x.addEventListener('error',function(){
   $(x).hide();
});

推荐阅读