如何在ie11上查看Webp格式 [英] How to view webp format on ie11

查看:556
本文介绍了如何在ie11上查看Webp格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

无论如何,是否可以在IE11上查看webp图像格式,或者可以在此浏览器上使用javascript代码将其转换为另一种格式? 我尝试使用图片"元素,但似乎无法像Chrome62一样工作

Is there anyway to view webp image format on IE11 or can convert it to another format with javascript code on this browser? I tried "picture" element but seems like it cann't work like Chrome62

推荐答案

是也是一种非常易于使用且有效的polyfill,用于在IE或其他不支持WebP渲染的浏览器上渲染WebP图像.这是使用方法:-

This is also a very easy-to-use and effective polyfill for rendering WebP images on IE or other browsers which do not support WebP rendering. Here is how to use it:-

<script src="https://unpkg.com/webp-hero@0.0.0-dev.21/dist-cjs/polyfills.js"></script>
<script src="https://unpkg.com/webp-hero@0.0.0-dev.21/dist-cjs/webp-hero.bundle.js"></script>
<script>
 var webpMachine = new webpHero.WebpMachine();
 webpMachine.polyfillDocument();
</script>

这篇关于如何在ie11上查看Webp格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆