(function() { var s = document.currentScript; if (!s) { var scripts = document.getElementsByTagName('script'); s = scripts[scripts.length - 1]; } var h4w = function(w) { return 1700; }; var a = document.createElement('a'); a.href = s.src; var p = a.search, w = p ? parseInt(p.split("width=")[1]) : null,h l = w ? w : s.parentNode.offsetWidth; h = h4w(l); var frame = document.createElement("iframe"); frame.style.cssText = "border: none; overflow: hidden;background:transparent;"; frame.style.width = w ? w + "px" : "100%"; frame.style.height = h + "px"; frame.name = 'iframe_tempo_real_eleicoes_2020'; s.parentNode.insertBefore(frame, s); var startIfVisible = function() { var rect = frame.getBoundingClientRect(); var hmax = Math.max(document.documentElement.clientHeight, parent.innerHeight); if ((rect.top > 0) && (rect.top < hmax)) { window.removeEventListener('scroll', startIfVisible); frame.src = "//" + a.host + "/widget.php"+ p+"&hostname="+location.hostname; } } window.addEventListener('scroll', startIfVisible); startIfVisible(); if (!w) { window.addEventListener('resize', function() { frame.style.height = h4w(s.parentNode.offsetWidth) + "px"; }); } })();

Comments

DESTAQUES/hot-posts