kennethcachia / background-check

Automatically switch to a darker or a lighter version of an element depending on the brightness of images behind it.
http://kennethcachia.com/background-check/
MIT License
3.27k stars 281 forks source link

Check if image is truly visible #31

Open tadaskarpavicius opened 10 years ago

tadaskarpavicius commented 10 years ago

Hey, when image is outside element's with overflow:hidden boundries (a gallery in my case), it is still visible to this plugin. This might help: https://github.com/UseAllFive/true-visibility

kennethcachia commented 10 years ago

Thanks!

Yes, at the moment there are very basic checks in place to determine if the image is still visible or not.

You can overcome this by refreshing the images attribute (ex: after a gallery transition) as follows, but it depends on your gallery implementation:

BackgroundCheck.set('images', '.gallery .active');
tadaskarpavicius commented 10 years ago

Thanks! That will work.