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 282 forks source link

targets: select parent instead of child selector #77

Closed chriseugenerodriguez closed 8 years ago

chriseugenerodriguez commented 8 years ago

Hi, I wanted to know if I could select the parent instead of all the children I want for background dark so I can style it easier than using individual selectors for each. Also I have a count down function ontop of an image and using backgroundcheck on it. countdown keeps firing and reseting the element so background dark never stays for ex.

http://demo.premiumwd.com/themes/mini/maintenance-page/

if($(".fullscreen.grey-section.parallax").length && $('.counter_holder').length || $('#count-down').length){ BackgroundCheck.init({ targets: ".counter_holder span, #count-down span, #count-down b, .stat-wrap small", images: ".fullscreen[style*='background-image']", minComplexity: 80, maxDuration: 1500, minOverlap: 0 })
BackgroundCheck.refresh();
}

I tried backgroundcheck.refresh which works but i have to keep scrolling any ideas?