rafaelbotazini / floating-whatsapp

This is a simple floating WhatsApp button plugin for jQuery.
MIT License
268 stars 218 forks source link

How to open Fake Chat Window programmatically? #10

Closed hmaesta closed 4 years ago

hmaesta commented 4 years ago

Hello, Rafael. Thank you the nice plugin.

How can I open the Fake Chat Window programmatically, like an API call?

For example:

$('.trigger').on('click', function () {
   $floatingWhatsApp.openChat();
});

Thanks! 👋

rafaelbotazini commented 4 years ago

Hey, Hugo.

The plugin doesn't have this feature yet.

I'm kinda short of time to implement this feature by now, but I will gladly accept a pull request if you or anyone else are willing to try and implement it.

You can also show the window by adding the class .active to the popup element:

$('.trigger').on('click', function () {
   $('.floating-wpp-popup').addClass('active');
});