", {
id: "show",
style:
"position: fixed; bottom: 20px; right: 20px; z-index: 9999; height: max-content; display:flex; background:#f47735; border-radius:50%;padding: 10px;",
});
var showImg = $("
", {
src: "https://drop-chat-files.s3.amazonaws.com/dropchat-assets/bubble-chat-show-icon.svg",
alt: "Hide",
style: "outline: none; cursor: pointer;width:30px;",
});
showButton.hover(function() {
$(this).css({"opacity": "0.8", "transform": "scale(1.2)", "transition": "0.3s"});
}, function() {
$(this).css({"opacity": "1", "transform": "scale(1)", "transition": "0.3s"});
});
showButton.append(showImg);
if(width > 1200){
var hideButton = $("
", {
id: "hide",
style:
"position: fixed; bottom: 20px; right: 20px; z-index: 9999; height: max-content; display:flex; background:#f47735; border-radius:50%;padding: 10px;",
});
var hideImg = $("
", {
src: "https://drop-chat-files.s3.amazonaws.com/dropchat-assets/bubble-chat-hide-icon.svg",
alt: "Show",
style: "outline: none; cursor: pointer;width:30px;",
});
} else {
if(device === "iOS") {
var hideButton = $("
", {
id: "hide",
style: "position: fixed;right: 4px;top: 1.4dvh; z-index: 9999;width:30px; height:max-content; text-align:center; display:flex; justify-content: center;",
});
} else {
var hideButton = $("
", {
id: "hide",
style: "position: fixed;right: 4px;top: 1.75dvh; z-index: 9999;width:30px; height:max-content; text-align:center; display:flex; justify-content: center;",
});
}
var hideImg = $("
", {
src: "https://book-chat.s3.amazonaws.com/5d94cd16-38aa-43d2-86fd-c5e87e77d2be/white-cross.svg-JTP54L.svg",
alt: "Show",
style: "outline: none; cursor: pointer; width:20px;",
});
}
hideButton.hover(function() {
$(this).css({"opacity": "0.8", "transform": "scale(1.2)", "transition": "0.3s"});
}, function() {
$(this).css({"opacity": "1", "transform": "scale(1)", "transition": "0.3s"});
});
hideButton.append(hideImg);
// add the buttons to the body of the page
$(".bubbleChatParent").append(showButton);
$(".bubbleChatParent").append(hideButton);
$("#hide").hide();
if(width > 1200){
$("#hide").click(function () {
$(".mobileIframe").css({"height": ""});
$(".bubbleChatIframe").hide();
$("#hide").hide();
$("#show").show();
});
} else {
$("#hide").click(function () {
$(".mobileIframe").css({"height": ""});
$(".bubbleChatIframe").hide();
$("#hide").hide();
$("#show").show();
$('html, body').css({
overflow: 'auto'
});
});
}
if(width > 1200){
$("#show").click(function () {
$(".mobileIframe").css({"height": "100%"});
$(".bubbleChatIframe").show();
$("#show").hide();
$("#hide").show();
});
} else {
$("#show").click(function () {
$(".mobileIframe").css({"height": "100%"});
$(".bubbleChatIframe").show();
$("#show").hide();
$("#hide").show();
$('html, body').css({
overflow: 'hidden'
});
});
}
});
$(document).ready(function () {
$(".bubbleChatIframe").hide();
$('head').append('
');
});