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

wordpress conflict? #25

Closed matchbranding closed 10 years ago

matchbranding commented 10 years ago

Hi, This script is awesome!

I am trying to use it just the same as your fixed-nav example but keep getting a conflict in Wordpress. I can't seem to pinpoint it but even tried to use a default template with no active plugins. I copied and pasted your code directly in the theme. Have you seen any issues specifically with WP? Thanks!

kennethcachia commented 10 years ago

Hi, Thanks!

What kind of conflict? Are you seeing any errors in the browser's console?

matchbranding commented 10 years ago

None that I could see.

Sent from my iPhone

On Mar 28, 2014, at 4:53 PM, Kenneth notifications@github.com wrote:

Hi, Thanks!

What kind of conflict? Are you seeing any errors in the browser's console?

— Reply to this email directly or view it on GitHub.

kennethcachia commented 10 years ago

Hm ok. I'll test this plugin with WP again just in case...

matchbranding commented 10 years ago

Thanks. Would love to figure out what's up so I can use this.

Sent from my iPhone

On Mar 28, 2014, at 5:07 PM, Kenneth notifications@github.com wrote:

Hm ok. I'll test this plugin with WP again just in case...

— Reply to this email directly or view it on GitHub.

kennethcachia commented 10 years ago

Hi!

I tested BackgroundCheck with the Twenty Twelve theme and I'm not seeing any issues on init.

However, I've noticed an issue when trying the fixed nav approach will all the images on the page. BackgroundCheck takes into consideration the dimensions of both the image and it's parent. If you use:

BackgroundCheck.set('debugOverlay', true)

you'll notice that images within .entry-content a are not processed properly. The following fixes the issue:

.entry-content a {
  display: block;
}

Are you seeing any other issues similar to the above?

matchbranding commented 10 years ago

For me it doesn't add the class at all. Not the best at debugging but removed all other plugins. Was testing with twenty eleven theme.

kennethcachia commented 10 years ago

Ok thanks. I'll close this issue for the time being but I'll revisit this thread if I encounter any other WP related issues.