Auto rotating Adsterra ads (2s)
";
const DIRECTLINK_URL = " //www.effectivegatecpm.com/mbkwhcvnf?key=574c135bdf5c29a9177a62fd988e0b41 ";
const socialWrap = document.getElementById('socialBarContainer');
const socialOuter = document.getElementById('socialBarWrap');
const directWrap = document.getElementById('directLinkWrap');
const directFrame = document.getElementById('directLinkFrame');
// initial state: show socialBar first
let showSocial = true;
// Helper to remove previous social script (if any) and injected nodes
function clearSocial() {
// remove previously injected script tags inside socialWrap
const scripts = socialWrap.querySelectorAll('script');
scripts.forEach(s => s.remove());
// optionally clear other nodes
Array.from(socialWrap.childNodes).forEach(node => {
// keep scripts removal handled above; remove any other nodes too
if (node.nodeType === Node.ELEMENT_NODE) node.remove();
});
// ensure container exists
const placeholder = document.createElement('div');
placeholder.id = 'social-placeholder';
socialWrap.appendChild(placeholder);
}
// Insert social script to socialWrap (so the external script will write into the DOM)
function loadSocialScript() {
clearSocial();
const scr = document.createElement('script');
scr.type = 'text/javascript';
// add cache-buster so it reloads each time
scr.src = SOCIAL_SCRIPT_SRC + (SOCIAL_SCRIPT_SRC.indexOf('?') === -1 ? '?' : '&') + 'cb=' + Date.now();
scr.async = true;
// append to the container so that the script's document.write / DOM insertion targets this area
socialWrap.appendChild(scr);
}
// Show directlink iframe (with cache-buster to force reload)
function loadDirectLink() {
// set src with cachebust
const url = DIRECTLINK_URL + (DIRECTLINK_URL.indexOf('?') === -1 ? '?' : '&') + 'cb=' + Date.now();
directFrame.src = url;
}
// Toggle visibility
function showSocialOnly() {
socialOuter.classList.remove('hidden');
directWrap.classList.add('hidden');
loadSocialScript();
}
function showDirectOnly() {
socialOuter.classList.add('hidden');
directWrap.classList.remove('hidden');
loadDirectLink();
}
// initial call
showSocialOnly();
// Interval: every 2000 ms toggle
const INTERVAL_MS = 2000;
setInterval(() => {
showSocial = !showSocial;
if (showSocial) {
showSocialOnly();
} else {
showDirectOnly();
}
}, INTERVAL_MS);
// Optional: allow user to close either ad by clicking on it (prevents persistent annoyance)
// clicking socialBar hides it until next toggle
socialOuter.addEventListener('click', () => {
socialOuter.classList.add('hidden');
directWrap.classList.remove('hidden');
showSocial = false;
loadDirectLink();
});
// clicking directlink hides it until next toggle
directWrap.addEventListener('click', () => {
directWrap.classList.add('hidden');
socialOuter.classList.remove('hidden');
showSocial = true;
loadSocialScript();
});
})();
Auto Scrolling Up and Down Page
Welcome to Auto Scrolling Page
The page scrolls down and up continuously...