求助,如何过滤网页中的FLASH
Posted: Oct 25 2011, 11:03
http://www.tianya.cn/publicforum/conten ... 5614.shtml
左边有1个FLASH广告,如何 写规则去掉,谢谢,其代码
左边有1个FLASH广告,如何 写规则去掉,谢谢,其代码
Code: Select all
var adsp_content_left_banner = document.getElementById("adsp_content_left_banner");
if (adsp_content_left_banner) { } else if (0) { /* PROX: Ad Function II Blocked - (AdKey.3 google_adsense_code_4) */
adsp_content_left_banner.style.display = "none";
google_adsense_code_4="";
}
var centerSWF = document.createElement("embed");
centerSWF.style.position = "absolute";
centerSWF.style.left = 0;
centerSWF.type = "pplication/x-shockwave-flash";
centerSWF.width = "120";
centerSWF.height = "600";
centerSWF.src = "http://801.tianyaui.com/res/2011/1018/1318918218452.swf";
centerSWF.setAttribute("wmode", "transparent");
var centerDiv = document.createElement("div");
centerDiv.style.position = "absolute";
centerDiv.style.left = "10px";
centerDiv.style.top = "10px";
centerDiv.style.zIndex = "100";
centerDiv.style.textAlign = "right";
var closeLink = document.createElement("img");
closeLink.src = "http://static.tianyaui.com/img/static/2008/tygg/c120.jpg";
closeLink.setAttribute("id", "adsp_content_left_close_btn");
closeLink.style.cursor = "pointer";
var tarLink = document.createElement("a");
tarLink.href = "http://807.tianya.cn/count?t=7jOCNeeayNhxRcWvnTsG&backurl=http://gamety.tianya.cn/gamead/sxd/2011/10/17/264131.shtml";
tarLink.target = "_blank";
var maskDiv = document.createElement("div");
maskDiv.style.position = "relative";
maskDiv.style.left = 0;
maskDiv.style.right = 0;
maskDiv.style.top = -22;
maskDiv.style.width = "120px";
maskDiv.style.height = "600px";
maskDiv.style.zIndex = "10";
maskDiv.style.backgroundColor = "#FFFFFF"
maskDiv.style.opacity = "0";
try { maskDiv.style.filter = "alpha(opacity=0)"; } catch (e) { }
maskDiv.style.cursor = "pointer";
tarLink.appendChild(maskDiv);
var parentDiv = document.createElement("div");
parentDiv.style.position = "relative";
parentDiv.style.display = "block";
parentDiv.style.width = "120px";
parentDiv.style.height = "600px";
parentDiv.appendChild(centerSWF);
parentDiv.appendChild(tarLink);
parentDiv.appendChild(closeLink);
centerDiv.appendChild(parentDiv);