Blur.js中的缓存前缀是什么?我正在尝试Blur.js
的演示代码并收到错误
Failed to load resource: the server responded with a status of 404 (Not Found) https://localhost:44300/none
我理解它与cacheKeyPrefix: 'blurjs-', //Prefix to the keyname in the localStorage object
有关。即使我排除了这个,我仍然会得到同样的错误。我想用什么对象指出这个?链接中的文档是有限的。如果您使用过Blur.js
请帮帮我。
$('.target').blurjs({
source: 'body', //Background to blur
radius: 5, //Blur Radius
overlay: '', //Overlay Color, follow CSS3's rgba() syntax
offset: { //Pixel offset of background-position
x: 0,
y: 0
},
optClass: '', //Class to add to all affected elements
cache: false, //If set to true, blurred image will be cached and used in the future. If image is in cache already, it will be used.
cacheKeyPrefix: 'blurjs-', //Prefix to the keyname in the localStorage object
draggable: false //Only used if jQuery UI is present. Will change background-position to fixed
});
答案 0 :(得分:1)
好的我解决了这个问题。 source
变量必须选择具有您想要模糊的图像的任何元素。
所以,如果我有像
这样的div<div class="blurry">
<div class="blurrys-kids"><div>
</div>
<style>
.blurry {
background: url('../Images/BlurryHasBadKids.jpg');// Important for blurry to have a Background Image
}
</style>
然后你必须使用Blur.js作为
$('.blurrys-kids').blurjs({
source: '.blurry',
overlay: 'rgba(255,255,255,0.33)',
radius: 10
});