metafizzy / flickity

:leaves: Touch, responsive, flickable carousels
https://flickity.metafizzy.co
7.53k stars 602 forks source link

IE 11 links in slides do not function when clicked #923

Closed alanski66 closed 5 years ago

alanski66 commented 5 years ago

In IE11 when a slide element contains a link (eg a navigation item), the link clicked does nothing. I got as far as capturing the click in IE11 but would really like it actually go to the link. Is there a solution for this?

var elem = document.querySelector('#flick');
var flkty = new Flickity( elem, {
    // options
    cellAlign: 'left',
    freeScroll: false,
    prevNextButtons: false,
    pageDots: false,
    contain: true,
    draggable: true
});

elem.addEventListener( 'click', function( event ) {
// only link clicks
if ( !matchesSelector( event.target, 'a' ) ) {
console.log("link clicked")
    return;
}
alanski66 commented 5 years ago

Resolved: turns out IE11 didn't like my html structure where i had