Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arrows appended inside .slickSlide do not work #3657

Open
su-narthur opened this issue Dec 7, 2018 · 6 comments
Open

Arrows appended inside .slickSlide do not work #3657

su-narthur opened this issue Dec 7, 2018 · 6 comments

Comments

@su-narthur
Copy link

su-narthur commented Dec 7, 2018

I have a carousel I'm working on which has distinct sections inside each slide which move around at certain breakpoints. I need the carousel's arrows to appear inside one of these sections of each slide. Using appendArrows does add the arrows to each slide's section, but the arrows don't work. Without looking at the Slick code responsible for handling the arrows, it doesn't seem like there should be a technical limitation here, as jQuery is quite capable of registering a click handler on all elements returned by a given selector.

http://jsfiddle.net/narthur/0nebp4qk/5/

Steps to reproduce the problem

  1. Append arrows anywhere inside .slick-slide using appendArrows option.
  2. Notice that the arrows do not work.

What is the expected behaviour?

Arrows appended inside .slick-slide should function the same as arrows appended outside .slick-slide.

What is observed behaviour?

Arrows appended inside .slick-slide do nothing when clicked.

More Details

  • Which browsers/versions does it happen on? Chrome 70.
  • Which jQuery/Slick version are you using? Slick 1.8.0; jQuery 1.9.1
  • Did this work before? No.
@su-narthur
Copy link
Author

su-narthur commented Dec 7, 2018

I was able to fix my specific issue with the following code:

jQuery('#carousel_id .slick-prev').on('click', function(){
	jQuery('#carousel_id').slick("slickPrev");
});
jQuery('#carousel_id .slick-next').on('click', function(){
	jQuery('#carousel_id').slick("slickNext");
});

This issue proposes that a similar fix be made in the library itself, so that appendArrows works inside .slick-slide without any extra work required.

@giuliac89
Copy link

The issue has not yet been solved! :(

@lgilders
Copy link

FYI: still a known issue; workaround allows arrows to work as intended.

@thiagofloriano
Copy link

My slick instance doesn't even append the arrows.

@ilievm
Copy link

ilievm commented Aug 4, 2021

You can still move buttons wherever you need by creating an empty div like .arrows-box, and with the help of jQuerry appending "prev "and "next" arrows to this box, it works for me.

@MaideAkdede
Copy link

MaideAkdede commented Apr 20, 2022

❗️ April 2022 : Issue still not been solved.

@su-narthur 's code work perfectly, thank you.

FYI: I had to wrap the code otherwise it didnt work

$(function () {
$('.carousel .slick-prev').on('click', function () {
        $('.carousel').slick("slickPrev");
    });
    $('.carousel .slick-next').on('click', function () {
        $('.carousel').slick("slickNext");
    });
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants