function cell_ad_display2() { var cell_ad_display_s = document.getElementsByClassName("achang_tw_rec2_ad"); for (var cell_ad_display_i = 0; cell_ad_display_i < cell_ad_display_s.length; cell_ad_display_i++) { if (cell_ad_display_s[cell_ad_display_i].getAttribute('ad') != 'display') { var ad_div = document.createElement('div'); ad_div.innerHTML = '
'; cell_ad_display_s[cell_ad_display_i].appendChild(ad_div); window.achang_tw_rec2_native = window.achang_tw_rec2_native || []; window.achang_tw_rec2_native.push("b437aced-66fe-4721-b0b7-93257057d8f0"); window.achang_tw_rec2_publisherUrl = "https://yummyyummy.tw/"; window.achang_tw_rec2_apiKey = "TYGHN5YMRB98QK332H6Q"; (function(d) { var script = d.createElement("script"); script.async = true; script.src = "https://cell.adbottw.net/dy/ads/native/?ca=achang_tw_rec2"; d.body.appendChild(script); })(document);var styleElement = document.createElement("STYLE"); styleElement.innerHTML = ".achang_tw_rec2 .native-ad-b437aced-66fe-4721-b0b7-93257057d8f0.ad_style{padding:0 10 0 10px;}\ .achang_tw_rec2 {margin-right:auto }\ .achang_tw_rec2_ad {width:33%;margin:0px }\ //.achang_tw_rec2 .native-ad-b437aced-66fe-4721-b0b7-93257057d8f0.ad_style > a > div > img {height:127px!important;background-color:white!important}\ //.achang_tw_rec2 .native-ad-b437aced-66fe-4721-b0b7-93257057d8f0.ad_style > a{text-decoration:none;color: #000;font-weight: 500;font-size:14px}\ //.achang_tw_rec2 .native-ad-b437aced-66fe-4721-b0b7-93257057d8f0.ad_style > a > div.text > p.desc{display:none}\ .achang_tw_rec2 .native-ad-b437aced-66fe-4721-b0b7-93257057d8f0.ad_style a > div >h3{border:0px;margin-top:0px;color:#0088cc;margin-bottom:5px;color: #000;}.ad_style :nth-child(3){bottom:unset!important;text-align:right;position:relative!important;}\ .achang_tw_rec2 .native-ad-b437aced-66fe-4721-b0b7-93257057d8f0.ad_style > a > div > img {height:130px!important;background-color:white!important;max-width:100%!important}\ @media screen and (max-width: 1300px) and (min-width: 510px) {\ .achang_tw_rec2 .native-ad-b437aced-66fe-4721-b0b7-93257057d8f0.ad_style > a > div > img {width:100%!important}\ .achang_tw_rec2 .native-ad-b437aced-66fe-4721-b0b7-93257057d8f0.ad_style{width:100%;height:210px;}\ .achang_tw_rec2_ad {width:33%;overflow:hidden }\ }\ @media screen and (max-width: 509px) {\ .achang_tw_rec2 .native-ad-b437aced-66fe-4721-b0b7-93257057d8f0.ad_style > a > div > img {height:250px!important;width:100%!important}\ .achang_tw_rec2 .native-ad-b437aced-66fe-4721-b0b7-93257057d8f0.ad_style{height:280px;width:100%;}\ .achang_tw_rec2_ad {width:100%;height:320px }\ }\ .achang_tw_rec2 .native-ad-b437aced-66fe-4721-b0b7-93257057d8f0.ad_style > a {text-decoration:none!important;color: #000!important;font-weight:500;font-color:black!important;font-size:14px!important;text-align:center}\ .achang_tw_rec2 .native-ad-b437aced-66fe-4721-b0b7-93257057d8f0.ad_style > a > div.text > p.desc{display:none}\ .achang_tw_rec2 .native-ad-b437aced-66fe-4721-b0b7-93257057d8f0.ad_style a > div >h3{margin-bottom:5px;color:#0088cc;letter-spacing: 0.8px;padding:0% 1% 0% 1%;font-family: Overpass,sans-serif;font-size:1.15em;font-weight:500;background: transparent;text-align: left; line-height: 1.3;}\ //.achang_tw_rec2 .native-ad-b437aced-66fe-4721-b0b7-93257057d8f0.ad_style :nth-child(3){bottom:unset!important;display:inline;left:5px}\ .achang_tw_rec2 .native-ad-b437aced-66fe-4721-b0b7-93257057d8f0.ad_style :nth-child(3){bottom:10px!important;display:inline;right:25px!important;color: #ccc!important;float:right}\ .achang_tw_rec2 .native-ad-b437aced-66fe-4721-b0b7-93257057d8f0.ad_style :nth-child(3) > .sponsor-text {bottom:unset!important;display:none;}\ .achang_tw_rec2 .native-ad-b437aced-66fe-4721-b0b7-93257057d8f0.ad_style :nth-child(3)::before {content:\"=\"}\ .achang_tw_rec2 .native-ad-b437aced-66fe-4721-b0b7-93257057d8f0.ad_style :nth-child(3)::after {content:\"=\"}\ .achang_tw_rec2 .native-ad-b437aced-66fe-4721-b0b7-93257057d8f0.ad_style :nth-child(2) > img {display:none!important;}"; document.body.appendChild(styleElement); cell_ad_display_s[cell_ad_display_i].setAttribute('ad', 'display'); } } } function fetch_ads_rec2(){ var getads = document.getElementsByClassName("achang_tw_rec2"); Array.prototype.forEach.call(getads, function(el) { el.setAttribute('style','display:flex;flex-flow: wrap;place-content: space-between;'); if(el.getAttribute('ad')!='display'){ var ad_div = document.createElement('div'); ad_div.classList.toggle('achang_tw_rec2_ad'); el.appendChild(ad_div); //cell_ad_display(); var ad_div = document.createElement('div'); ad_div.classList.toggle('achang_tw_rec2_ad'); el.appendChild(ad_div); //cell_ad_display(); var ad_div = document.createElement('div'); ad_div.classList.toggle('achang_tw_rec2_ad'); el.appendChild(ad_div); //cell_ad_display(); //cell_ad_display(); //var styleElement = document.createElement("STYLE"); //styleElement.innerHTML = ".ad_style{width:300px}.ad_style > a > div > img {height:127px!important;background-color:white!important} .ad_style > a{text-decoration:none!important;color: #000!important;font-weight: 500;font-color:black!important;font-size:14px!important;text-align:center} .ad_style > a > div.text > p.desc{display:none} .ad_style a > div >h3{margin-bottom:5px}.ad_style :nth-child(3){bottom:unset!important;display:none;}.ad_style:nth-child(2){display:none!important;}"; //document.body.appendChild(styleElement); el.setAttribute('ad','display'); } }); //if(document.querySelector('div[id^="dablewidget"]').remove(); /* if(document.querySelectorAll('div[id^="dablewidget"]').length>0){ //console.log('yes'); document.querySelectorAll('div[id^="dablewidget"]')[0].remove(); }; */ //cell_ad_display2(); ga('achang_tw_rec2.send', 'event', 'load', location.hostname, location.href); if (document.body.clientWidth <= 500) { window.setTimeout(function(){ },3000); } } //window.setTimeout(function(){fetch_ads_rec();}, 5000); //window.setTimeout(function(){fetch_ads_rec2();}, 3000); //window.setTimeout(function(){fetch_ads_rec2();}, 5000); fetch_ads_rec2(); //cell_ad_display(); //window.setTimeout(function(){ (function(){ var ad_width = "220px"; var ad_height = "220px"; var trc_rbox_outer_width = "100%"; if (document.body.clientWidth <= 500) { ad_width = "100%"; trc_rbox_outer_width = (document.body.clientWidth-10)+'px'; ad_height = "300px"; } var ins_div = document.createElement('div'); ins_div.style.width = ad_width; ins_div.style.margin = '5px'; var ins_div_string = '
'; ins_div.innerHTML += ins_div_string; let ins_div1 = ins_div.cloneNode(true); let ins_div2 = ins_div.cloneNode(true); let ins_div3 = ins_div.cloneNode(true); var ins_parent = document.querySelectorAll('.achang_tw_rec2 .achang_tw_rec2_ad'); //ins_parent[0].parentNode.insertBefore(ins_div,ins_parent[0]); if(ins_parent.length>0){ //ins_parent[0].insertAdjacentElement('afterend', ins_div); var ins_script_parent = ins_parent[0].parentNode; ins_parent[0].replaceWith(ins_div1);ins_parent[1].replaceWith(ins_div2);ins_parent[2].replaceWith(ins_div3); var styleElement = document.createElement('style'); styleElement.innerHTML = ".trc_rbox_outer{height:"+ad_height+";width:"+trc_rbox_outer_width+";}.trc_rbox{width: "+trc_rbox_outer_width+" !important; height: 100% !important;}";document.body.appendChild(styleElement); /*var ins_script = document.createElement('script'); ins_script.src = "https://cdn2.ad2n.com/cdn/2/showads.js"; ins_script_parent.appendChild(ins_script); */ } })(); //}, 6500);