question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Arrows appended inside `.slickSlide` do not work

See original GitHub issue

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.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:6

github_iconTop GitHub Comments

6reactions
su-narthurcommented, 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.

0reactions
MaideAkdedecommented, 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");
    });
});
Read more comments on GitHub >

github_iconTop Results From Across the Web

Slick.js appendarrows doesn't work for multiple carousels
I used the following solutions which finds each navigation custom arrow from the slider wrapper. $('.
Read more >
Breakpoint Arrows Don't work well with variable slides - Drupal
Long story short, arrows do not always work when using breakpoints. The "expected" result is that arrows will "always" show up, if "arrows"...
Read more >
slick - the last carousel you'll ever need - Ken Wheeler
slick is a responsive carousel jQuery plugin that supports multiple breakpoints, CSS3 transitions, touch events/swiping & much more!
Read more >
slick carousel append Dots - Drupal Answers - Stack Exchange
Inside the slick option set, under the "Settings" tab, i checked the box "Arrows" and i changed the code for Previous and Next...
Read more >
How to Set Up Slick Slider (with arrows) - Travis Media
If you open up slick-theme.css or slick-theme.scss, you will see that the fonts folder is being referenced. In the font-face with css (src:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found