MAPG-116 attach loading animation to anchors and not to beforeunload
This commit is contained in:
parent
16bcbaecbe
commit
5e28fcb64d
@ -1,7 +1,15 @@
|
|||||||
<script>
|
<script>
|
||||||
window.addEventListener('beforeunload', function (e) {
|
(function () {
|
||||||
|
var anchors = document.getElementsByTagName('a');
|
||||||
|
for (var i = 0; i < anchors.length; i++) {
|
||||||
|
var a = anchors[i];
|
||||||
|
if (a.target !== '_blank') {
|
||||||
|
a.onclick = function () {
|
||||||
document.getElementById('loading').style.visibility = 'visible';
|
document.getElementById('loading').style.visibility = 'visible';
|
||||||
});
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})();
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
Loading…
Reference in New Issue
Block a user