forked from Anishkagupta04/RAPIDOC-HEALTHCARE-WEBSITE-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgoogletranslate.js
27 lines (22 loc) · 829 Bytes
/
googletranslate.js
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
document.addEventListener('DOMContentLoaded', function() {
// Get the popup
var popup = document.getElementById('translatePopup');
// Get the button that opens the popup
var btn = document.getElementById('translateButton');
// Get the <span> element that closes the popup
var span = document.getElementsByClassName('close')[0];
// When the user clicks the button, open the popup
btn.onclick = function() {
popup.style.display = 'block';
}
// When the user clicks on <span> (x), close the popup
span.onclick = function() {
popup.style.display = 'none';
}
// When the user clicks anywhere outside of the popup, close it
window.onclick = function(event) {
if (event.target == popup) {
popup.style.display = 'none';
}
}
});