Tagged: ,

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #719057

    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

    #720406

    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

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.