background-check icon indicating copy to clipboard operation
background-check copied to clipboard

BackgroundCheck.refresh() refreshing but not updating class

Open cgrant992 opened this issue 10 years ago • 2 comments

I'm using this plugin with the jQuery Revolution slider and am having problems getting the refresh to work correctly on new slides. It seems that it is refreshing, but it's not adding the correct background class. Here's the code I have:

document.addEventListener('DOMContentLoaded', function() {
  var img = document.querySelector('.tp-bgimg');
  img.setAttribute('crossorigin', '');
  img.src = img.getAttribute('src');

  // Prepare BackgroundCheck
  BackgroundCheck.init({
    targets: '#navigation ul li a',
    images: img
  });

  revapi1.bind("revolution.slide.onchange", function(e) {
    BackgroundCheck.refresh();
  });
});

Any idea why it's not working correctly? Seems it's only finding the first slide. When I view the developer tool in Chrome it shows it's not affecting the other slides, so it's only refreshing for the first slide. Could that be because RevSlider adds that code through JS instead of HTML?

cgrant992 avatar Mar 29 '15 23:03 cgrant992

I'm having the same tragedy with revolution slider... And I can't find a way to achive it.

¿Did you found it in the end?

zigmasdirigeant avatar May 02 '16 00:05 zigmasdirigeant

Same problem here without any slider ... Just a normal dynamic div ( hamburger menu ) . Can not refresh when menu appears .

krembo99 avatar Sep 28 '16 02:09 krembo99