How to add an HTML code to my website so that when people click it, it opens a WhatsApp conversation with me
We start by adding the libraries and CSS to the header of your website.
Now you must add a div with the WAButton ID, which is where the plugin will render the click to chat button.
You must add a script block where the plugin is used on the div that we added in the previous step.
- $(function () {
- $('#WAButton').floatingWhatsApp({
- phone: 'WHATSAPP-PHONE-NUMBER', //WhatsApp Business phone number
- headerTitle: 'Chat with us on WhatsApp!', //Popup Title
- popupMessage: 'Hello, how can we help you?', //Popup Message
- showPopup: true, //Enables popup display
- buttonImage: '', //Button Image
- //headerColor: 'crimson', //Custom header color
- //backgroundColor: 'crimson', //Custom background button color
- position: "right" //Position: left | right
- });
- });
Replacement in Line 4:- WHATSAPP-PHONE-NUMBER with your WhatsApp mobile number in International Format.
Artigos semelhantes
- How to add a GIF image using HTML code
- How to make the background image of a button disappear when we click it, and make it appear on another button when we click it in Visual Studio
- How to download a website (all coding HTML, CSS, JavaScript) and make a similar website in Bootstrap
- Can I add people on my private Snapchat story after it’s already been created?