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

Uncaught [object HTMLDivElement] is not a target #113

Open tabaktoni opened 5 years ago

tabaktoni commented 5 years ago
$('#carouselExampleIndicators').bind('slide.bs.carousel', function (e) {
        console.log(e.relatedTarget);
        BackgroundCheck.refresh(e.relatedTarget);
    });

I'm getting next image that will be shown after slider complete sliding with e.relatedTardet. It is Target element injected into event from bootstrap carousel. But i get all the time [object HTMLDivElement] is not a target, and it is target.

Target is not img as <IMG ...> it is <DIV ...> with backgeround from bootstrap carousel example.

thomasPierreATECNA commented 3 years ago

You can do this :

BackgroundCheck.set('targets', 'e.relatedTarget');
BackgroundCheck.refresh();