"WhatsApp Chatbot Popup"
Bootstrap 4.1.1 Snippet by davahiatak1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<style type="text/css">
.chatpopup-widget-close,
.chatpopup-widget__body-header,
.chatpopup-widget__trigger,
.chatpopup-welcome-msg {
background-color: #1fad00;
color: #ffffff;
}
.chatpopup-widget {
right: 12px;
align-items: flex-end;
}
.chatpopup-widget-close {
right: 0;
}
.chatpopup_jwi {
right: 12px;
}
.chatpopup-welcome-msg {
border: 1px solid #ccc;
color: #999;
background: #fff;
line-height: 1em;
padding: 8px 15px 5px 10px;
position: relative;
}
.chatpopup-welcome-msg:before {
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
@keyframes blink {
from,
to {
color: transparent
}
50% {
color: black
}
}
@-moz-keyframes blink {
from,
to {
color: transparent
}
50% {
color: black
}
}
@-webkit-keyframes blink {
from,
to {
color: transparent
}
50% {
color: black
}
}
@-ms-keyframes blink {
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
$(".chatpopup-icon-close").on('click', function(event) {
event.preventDefault();
$(".chatpopup-widget__body").hide(400);
});
$(".chatpopup-widget__trigger").on('click', function(event) {
event.preventDefault();
$(".chatpopup-widget__body").show(400);
});
$(".chatpopup-input-icon").on('click', function(event) {
event.preventDefault();
sendMessage();
});
$("input[name=message_to_send]").on('keydown', function(event) {
console.log(event.which);
if(event.which == 13){
sendMessage();
}
});
function sendMessage() {
var number = "22892971128";
var message = $("input[name=message_to_send]").val();
if (message === undefined || message === "") {
message = "Salut j'ai visité votre ce lien sur votre site" + " "+ location.href + " "+ "et j'ai besoin de plus d'information...".replace(" ", "%20");
} else{
message += " " + location.href;
}
var url = "https://api.whatsapp.com/send?phone="+ number +"&text="+ message;
$("input[name=message_to_send]").val("");
window.open(url, '_blank');
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments: