Created
October 4, 2021 15:57
-
-
Save sagarjadhav/c1895d00e0c17ca4c815ab4ae1c85b18 to your computer and use it in GitHub Desktop.
Slick slider custom Paging with Image and accessibility
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$( document ).on( 'ready', () => { | |
$( '.slider-nav' ).slick( { | |
responsive: [ | |
{ | |
breakpoint: 767, | |
settings: { | |
dots: true, | |
customPaging: function( slick, index ) { | |
var targetImage = slick.$slides.eq( index ).find( 'img' ).attr( 'src' ); | |
return '<button><img src=" ' + targetImage + ' " alt="image" /></button>'; | |
} | |
} | |
} | |
] | |
} ); | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment