blur.js试图请求“无”和div不扩大100% [英] blur.js trying to request "none" and div not expanding 100%

查看:109
本文介绍了blur.js试图请求“无”和div不扩大100%的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用 http://blurjs.com/ 来模糊标题栏的标题图片的BG。但是它给了我一个有趣的错误,我似乎不能跟踪。它可能是与主要代码,兼容性,但我不知道。

I'm trying to use the http://blurjs.com/ to blur our the header bar's BG of the header image. However it gives me a interesting error I can't seem to track down. It may be something to do with the main code, and compatibility, but I'm not sure.

http://jordan.rave5.com/tmp/

错误是


无法载入资源:伺服器回应状态404(找不到) http://jordan.rave5.com/tmp/none

此外,当内容框较小时,页面首次初始化加载时,background-gradient div无法扩展100%。我尝试添加另一个div在100%或更大的推出,但它只是最终推进页脚进一步向下,当内容区域扩展。辛达烦恼。

Also the background-gradient div is having trouble expanding 100% when the page is first initialing loading when the content box is small. I've tried adding a another div within it at 100% or bigger to push it out, but it just ends up pushing the footer further down when the content area expands. Kinda annoying.

推荐答案

您的代码在blurjs.js的285行失败。这是因为blurjs在你传递的元素上寻找一个css属性作为 source (第202行)。您正在设置 .header-img (图像元素)作为源选项,因此blurjs找不到 background-image 属性,因此会返回css属性的默认值, none ,因此当您尝试使用该值加载图像时会出现错误。在第202行更改blurjs.js:

Your code fails at line 285 of blurjs.js. This is because blurjs is looking for a css property on the element you pass in as the source (line 202). You are setting up .header-img (an image element) as the source option and so blurjs can't find a background-image property on it hence the default value of the css property is returned, none and so you get the error when you try to load an image with that value. Change blurjs.js at line 202:

var formattedSource;
if($source.is('img'))
    formattedSource = $source.attr('src');
else
    formattedSource = ($source.css('backgroundImage')).replace(/"/g, "").replace(/url\(|\)$/ig, "");

这篇关于blur.js试图请求“无”和div不扩大100%的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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