ksachdeva / angular-swiper

Angular directive for nolimits4web/Swiper
Apache License 2.0
197 stars 94 forks source link

To do .getElementsBy #44

Closed JamalANasier closed 8 years ago

JamalANasier commented 8 years ago

Hello.. thanks for this plugin, i've been using this in my project.

I do have trouble to do .getElementsBy, which is inside the active slide on the swiper container. Have tried many options but the return always value from the last or the first slide. One of the code i've tested

 swiper.on('slideChangeEnd', function () {
                var swTest = document.getElementsByClassName("swiper-slide-active");
                if (swTest = 'swiper-slide-active'){
                    var swName = document.getElementById("name").textContent;
                    console.log (swName);
                }
            });

Anyone can help me on this ? Thanks

solution : var swTest = document.querySelector('.swiper-slide-active h1').innerHTML;

JamalANasier commented 8 years ago

Finally i can resolve this issue.. thanks for this plugin.

closed this one 👍