I have a flickity.js carousel set up on my website and I want to add a couple of mailto
links to it. Static clicks do not work in the carousel by default, so I had to use staticClick.flickity
event to catch it:
https://codepen.io/Deka87/pen/zEJrLY
// Catch click events
$(".carousel").on("staticClick.flickity", function(event, pointer) {
var tagName = pointer.path[0].tagName;
if (tagName == "A") {
var href = pointer.path[0].href;
window.location.href = href;
alert(href);
}
});
While the href
value is retrived OK, the window.location.href
part doesn't work for some reason, i.e. mail client is not triggered. Any ideas how to fix this?