However, on each subsequent page load the chat window re-opens for the web visitor.
$zoho.livedesk.ready=function(){
$zoho.livedesk.floatbutton.visible("hide");
function checkWidth2() {
var winSize = $(window).width();
if (winSize <= 1024) {
$zoho.livedesk.floatbutton.visible("hide");
$zoho.livedesk.floatwindow.visible("hide");
$('.chatWrap').hide();
}
else if (winSize > 1024){
$('.chatWrap').show();
$zoho.livedesk.floatwindow.visible("hide");
$zoho.livedesk.floatbutton.visible("hide");
$zoho.livedesk.floatwindow.close(function(){
$zoho.livedesk.floatbutton.visible("hide");
});
$zoho.livedesk.floatwindow.minimize(function(){
$zoho.livedesk.floatbutton.visible("hide");
});
function toggleZoho() {
if ($zoho.livedesk.floatwindow.visible("hide")) {
$zoho.livedesk.floatwindow.visible("show");
}
else {
$zoho.livedesk.floatwindow.visible("hide");
}
}
$('.chatWrap').click(function () {
toggleZoho();
});
$('.modalpopup').on('click', '.chatWrap', function () {
toggleZoho();
});
}
}
checkWidth2();
$(window).resize(checkWidth2);
}
Thanks in advance for any help.