Want to show a loading spinner where your survey will appear? You can add one on any page where your survey loads with the Custom Embed script.
To do this, add the following code to your page, right next to the element your survey attaches to:
<div id="kno-loading-div">
<div class="kno-dual-ring"></div>
<p>We'd love your feedback! Checking for a survey...</p>
</div>
<style>
#kno-loading-div {
display: flex;
align-items: center;
flex-direction: column;
padding: 50px 0px;
}
.kno-dual-ring {
display: inline-block;
width: 60px;
height: 60px;
margin-bottom: 10px
}
.kno-dual-ring:after {
content: " ";
display: block;
width: 44px;
height: 44px;
margin: 8px;
border-radius: 50%;
border: 6px solid #000;
border-color: #000 transparent #000 transparent;
animation: kno-dual-ring 1.2s linear infinite;
}
@keyframes kno-dual-ring {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
</style>
<script>
/*
* Hide loader
*/
var checkKnoRuns = 0;
var checkKnoSurvey = setInterval(function() {
checkKnoRuns += 1;
var kno_found = document.querySelector("#kno-survey-embed #__k");
if (kno_found != null) {
console.log('kno found');
document.getElementById("kno-loading-div").style.display = "none";
clearInterval(checkKnoSurvey);
} else if (checkKnoRuns === 100){
console.log('kno not found');
document.getElementById("kno-loading-div").style.display = "none";
clearInterval(checkKnoSurvey);
}
}, 100); // check every 100ms
</script>
This can be customized however you like (we recommend changing the text at the top).

