<图片及GT; src(活动源) [英] <picture> src (active source)

查看:100
本文介绍了<图片及GT; src(活动源)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在不使用视口宽度/像素密度的情况下在javascript中检索< picture> 元素当前使用的源?

Is there a way to retrieve a <picture> element's currently used source in javascript without using the viewport width / pixel density?

类似的内容< select>:已选择

任何人都可以这个?

推荐答案

< picture> 元素仍然是实验性的,所以我认为还没有API来获取活跃源。但是,我确实为< picture> 规范找到了以下问题,期望该元素具有 currentSrc 元素。

The <picture> element is still experimental so I do not think there is an API to get the "active" source yet. I did however find the following issues for the <picture> spec expecting the element to have a currentSrc element.

https://github.com / ResponsiveImagesCG / picture-element / issues / 223

currentSrc 是我也会有的行为预计但目前它还没有在Chrome或FireFox中实现。

currentSrc is the behaviour I also would have expected but currently it is simply not implemented in Chrome or FireFox.

这篇关于&LT;图片及GT; src(活动源)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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