Comments (5)
Yup same error for me:
"Uncaught Element is not an <img> but does not have a background-image"
In my case the script breaks. I assume it's some kind of conflict with other scripts on the site as it works on the blog section. I'll report back if I track the conflict down.
from background-check.
I had the same issue. It is because the script throws an error if it doesn't find the elements. However in my case I just don't care if it doesn't find anything, I don't want that all my scripts suddenly stop working because of this. I adjusted line 167 and 189 to not throw an error. (just commented the lines with 'throw' out). Perhaps it should only inform the user when debug is enabled? Are there any side effects in removing the throw declarations?
from background-check.
Since it is quite impossible to always have all elements in all pages of a website, the script should definitely not throw "Uncaught" errors. Just quietly ignore the "not found" elements seems better.
from background-check.
I got around this by checking for the class name that triggers the script before initializing it on a page. Definitely agree that it should just fail gracefully if nothing is found.
if( $('.bgcheck')[0] ) {
BackgroundCheck.init({
targets: '#back-to-top',
images: '.bgcheck',
threshold: 70
});
}
from background-check.
I had the same problem and could only fix it by adding the background-image property inlined instead of declaring it in my stylesheet
from background-check.
Related Issues (20)
- Images not being targeted in FF53
- Unable to get image data from canvas because the canvas has been tainted by cross-origin data. HOT 2
- Target: Check not only image but any background?
- Using with FullPage.js HOT 1
- HTML-Element containing image with overflow:hidden; - invisibility of image is ignored
- is there a way to detect after? HOT 1
- Classes not added to element HOT 1
- cross origin not working.
- Finding image, but not sorting HOT 1
- Cross origin demo not working HOT 1
- Owl carousel not working with background-check
- Error: Area too small but image is there
- Uncaught [object HTMLDivElement] is not a target HOT 1
- Janky Colour Swapping HOT 2
- Edit color sensibility
- Doesn't seem to work HOT 2
- Not able to detect specific area of image
- The canvas has been tainted by cross-origin data. HOT 7
- Nested/Child elements with classname HOT 2
- For God's sake - update it!
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from background-check.