在使用eager.io安装pace.js时,我能够隐藏所有内容,直到页面加载为止.
但是,当使用bower安装插件并下载css主题时,我无法弄清楚如何执行此操作.
与如何让 SVG 图像从 HTML 文档继承颜色相同的问题?,但特别是当应用于用作:before伪元素内容的 svg 图像时。
(期望的行为是两个复选标记都从主体继承红色。目前只有内联 SVG 这样做。)
<style type='text/css'>
body {
color: red;
}
.checkmark {
height: 2em;
width: 2em;
}
.checkmark:before {
content: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100%' height='100%' viewBox='-0.5 0 20 15'><rect fill='currentColor' stroke='none' transform='rotate(45 4.0033 8.87436)' height='5' width='6.32304' y='6.37436' x='0.84178'></rect><rect fill='currentColor' stroke='none' transform='rotate(45 11.1776 7.7066)' width='5' height='16.79756' y='-0.69218' x='8.67764'></rect></svg>");
}
</style>
<!-- Renders red -->
<svg xmlns='http://www.w3.org/2000/svg' width='2em' height='2em' viewBox='-0.5 0 20 15'><rect fill='currentColor' stroke='none' transform='rotate(45 4.0033 8.87436)' height='5' width='6.32304' …Run Code Online (Sandbox Code Playgroud) 我正试图在用户离线时提醒他们,并显示一条简单的消息.我正在使用Offline.js作为库(Offline.js网站).
我想写JS而不是使用Eager自动安装它.
这是我写的,但似乎没有用.有人可以帮我详细说明吗?
我在图书馆网站上找不到包含代码的示例.
Offline.options = {checkOnLoad: true, checks: {image: {url: 'http://www.vitaminedz.com/photos/49/02-49565-front-de-mer-a-oran.jpg'}, active: 'image'}}
Offline.check();
Offline.on('up', alert('up'));
Offline.on('down',alert('down'));
Run Code Online (Sandbox Code Playgroud)