I'm using the Wordpress MetaSlider plugin for slides, and it's possible to add links to the images.
I created a button and need to simulate click
, just as I was clicking on the currently active image in the slider.
I'm using trigger
to do the simulation, but I can not make trigger
work.
<div class="img-slider">
<?php
echo do_shortcode("[metaslider id=135]");
?>
<div class="div-button-box-slider">
<button class="button saiba-mais"> SAIBA MAIS </button>
</div>
</div>
Image of the code generated by the plugin: Script:
<script>jQuery('.saiba-mais').click(function(e){e.preventDefault();console.log("You clicked!" );
jQuery(".flex-viewport .slides .flex-active-slide a").trigger("click");
});