Add a timer on the closeelement

This commit is contained in:
Amauri CHAMPEAUX 2021-04-28 12:14:04 +02:00
parent 4cf393cd40
commit b091e07cc5
1 changed files with 9 additions and 5 deletions

View File

@ -595,11 +595,15 @@ var tarteaucitron = {
}, 1500);
}
if(tarteaucitron.parameters.closePopup === true){
var closeElement = document.getElementById('tarteaucitronAlertBig'),
closeSpan = document.createElement('span');
closeSpan.textContent = 'X';
closeSpan.setAttribute('id', "tarteaucitronCloseCross");
closeElement.insertBefore(closeSpan, closeElement.firstElementChild);
setTimeout(function() {
var closeElement = document.getElementById('tarteaucitronAlertBig'),
closeSpan = document.createElement('span');
if (closeElement) {
closeSpan.textContent = 'X';
closeSpan.setAttribute('id', "tarteaucitronCloseCross");
closeElement.insertBefore(closeSpan, closeElement.firstElementChild);
}
}, 100);
}