Hi.
I would like to run a JavaScript that shows a booking form when I click a button that have been added to my Easy Full Width Slider.
The button currently only have a link – as that is what is supported (using the Avia Page Builder).
Is there an easy way for me to get the button to run a JavaScript rather than having the button linking to a page?
The button can be seen here: http://skagenfiskerestaurant.dk/
It is the red button in the top slider with the text “BOOK BORD”
Regards
Dennis B
Hey ProSEO,
Try setting the link manually then assign # as link. Then on functions.php add this code:
function add_custom_script(){
?>
<script type="text/javascript">
(function($){
function myscript() {
$("#top.page-id-6 #full_slider_1 .slide-2 .avia-slideshow-button.avia-color-theme-color").click( function() {
alert('button clicked');
}
);
}
myscript();
})(jQuery);
</script>
<?php
}
add_action('wp_footer', 'add_custom_script');
Just replace this part alert(‘button clicked’); with the function calling. Hope this helps.
Best regards,
Nikko