Closed h0r0m4n closed 10 years ago
nope. it will check only the first slide. although i've said "images: .flex-active-slide > img"
BackgroundCheck.init({ targets: '.flex-direction-nav a', images: '.flex-active-slide > img' });
Sliders are tricky!
Apart from calling BackgroundCheck.init()
on load, you also need to call Background.refresh()
after each transition to reprocess targets. FlexSlider has an after
attribute which is a function called after each slide transition, and can be used as follows:
$('.slider').flexslider({
animation: 'slide',
start: function () {
BackgroundCheck.init({
targets: '.flex-direction-nav li a',
images: '.slides img'
});
},
after: function () {
BackgroundCheck.refresh();
}
});
That's exactly what I do. But it won't work with flexslider. The refresh will only check the first image and not the active slide as the debug info will show that.
Hm.. do you have an online version that I can debug?
For sure: http://kunden.alexanderalbrecht.ch/zeh/textseite.html debug is set to true
here is what i run for flexslider.
$('.flexslider').flexslider({
animation: "fade",
easing: "swing",
direction: "horizontal",
animationLoop: true,
slideshow: true,
slideshowSpeed: 7000,
animationSpeed: 300,
pauseOnHover: true,
pauseInvisible: true,
useCSS: true,
touch: true,
controlNav: false,
prevText: "Vorheriges Bild",
nextText: "Nächstes Bild",
keyboard: true,
// Callback API
start: function(){
BackgroundCheck.init({
targets: '.flex-direction-nav a',
images: '.flex-active-slide > img',
debug: true
});
},
after: function(){
BackgroundCheck.refresh();
}
});
Has anyone was able to make it work with FlexSlider 2?