sachinchoolur / lightslider

JQuery lightSlider is a lightweight responsive Content slider with carousel thumbnails navigation
http://sachinchoolur.github.io/lightslider/
MIT License
2.04k stars 1.53k forks source link

How use keypress in multiple gallery from Lightslider #378

Open thallysondias opened 6 years ago

thallysondias commented 6 years ago

I'm using Lightslider to create different galleries on my page, however, I want to use the keyboard's directional keys to change the gallery image, when using directional, all images (of all galleries on the pages) change.

How can I change the image of the gallery that is in focus on the page?

https://jsfiddle.net/thallysondias/9omt6vo7/1/

I trying to use in this site (navigation full keypress): http://argo.digital/sergiosantos.com.pt/

  $('.content-slider').each(function (index) {
    $(this).lightSlider({
        auto:false,
        loop: true,
        keyPress:true,
        controls: true,
        prevHtml: '←',
        nextHtml: '→',
        item:1,
        pager:false,
        onBeforeSlide: function (el) {
            $('#counter' + index).text(el.getCurrentSlideCount());
        }
    });
});

I tryed a "solution" 266 (https://github.com/sachinchoolur/lightslider/issues/266), but doens't work's.

Thanks for hellping

mikeroyer commented 6 years ago

I'm encountering this same issue.