Home Forums Basel support forum Onclick code for Basel button

Onclick code for Basel button

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #227602

    tom4lfc123
    Participant

    Hello,

    Where can we add on click code for the Basel button on the page builder?

    Thanks

    #227612

    Hello,

    I am not sure I got your idea, however as far as understand your question, you can find the button in the Theme elements tab. https://xtemos.com/docs/basel/shortcodes/

    Best Regards

    #230003

    tom4lfc123
    Participant

    Hello,

    Sorry I was not very clear with my previous message.

    I have the Tidio live chat widget installed on the website and I would like to add the following code to the Basel theme element button so that when the button is clicked it opens the Tidio chat widget:

    window.tidioChatApi.show(); window.tidioChatApi.open();

    The standard WPBakery button element has an option for adding javascript code executed when the button is clicked. See screenshot here – http://prntscr.com/uqu5op

    How can I do this with the Basel theme button element?

    #230083

    Hello,

    Please create a button from WP Bakery page builder and insert a class as it is: tidio-button http://prntscr.com/ur1782

    Then add this code to the Theme Settings > Custom JS > On document ready https://prnt.sc/ur17fw :

    jQuery('.tidio-button').on('click', function(){
    	window.tidioChatApi.show();
    	window.tidioChatApi.open();
    });

    Best Regards

Viewing 4 posts - 1 through 4 (of 4 total)