一个JS文件控制所有的浮窗

//自动检测是否加载jquery
(function(){
	if(typeof jQuery == 'undefined'){
		document.write('<script src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js\"><\/script>');
	}
})();

function openZoosUrl(str)
{
	//location.href="/zxqq/";
	
	var w = screen.width * 0.86;     //宽度
	var h = screen.height * 0.8;   //高度
	var l = (screen.width-w)/2; //离左边距离
	window.open("http://www.onestopweb.cn/zixun/?f=" + str,'新开googleWin1',"height="+h+", width="+w+", top=0, left="+l+",toolbar=no, menubar=no, scrollbars=no, resizable=no, location=n o, status=no")
}

function goto_qq()
{
	location.href="http://www.onestopweb.cn/zxqq/";
	//window.open("/zxqq/");
}


//左侧 QQ
document.write('	<div id="qqBox" style="display: block;z-index: 2147483647; position: fixed !important; left: 10px; top: 50px;">	');
document.write('		<img src="http://www.onestopweb.cn/swt/swt_left.jpg" border="0" usemap="#qqBoxMap"  />	');
document.write('		<map name="qqBoxMap" id="qqBoxMap">	');
document.write('			<area shape="rect" coords="91,5,133,26" href="javascript:void(0)" οnclick="qq_hide();return false;" />	');
document.write('			<area shape="rect" coords="18,277,118,303" href="javascript:void(0)" οnclick="goto_qq();return false;" />	');
document.write('		</map>	');
document.write('	</div>	');


//右侧商务通
document.write('	<div id="swtBox" style="display: none;position:fixed; _position:absolute; top:50px; right:10px; _top:expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight-this.offsetHeight)); border:none; z-index:99999; cursor: pointer; ">	');
document.write('		<a href="javascript:void(0)" οnclick="hide_swt()" style="display:block; _position:absolute; cursor:pointer;" >	');
document.write('			<img src="http://www.onestopweb.cn/swt/x.gif" border="0" />	');
document.write('		<a href="javascript:void(0)" οnclick="openZoosUrl();return false;" rel="nofollow" target="_blank">	');
document.write('			<img src="http://www.onestopweb.cn/swt/YumDamMTR.gif" border="0" /></a>	');
document.write('	</div>	');


//中间部分的商务通
document.write('<div id="centerBox" style="display:block;">	');
document.write('	<div id="centerBox2" style="z-index: 2147483647; position: fixed !important; left: 50%; margin-left: -240px !important; top: 50%; margin-top: -210px !important;">	');
document.write('		<img src="http://www.onestopweb.cn/swt/zxswt.gif" width="419" height="340" border="0" usemap="#SwtMap" />	');
document.write('		<map name="SWTMap" id="SWTMap">	');
document.write('			<area shape="rect" coords="382,5,411,30" href="javascript:void(0)" οnclick="hide_center();return false;">	');
document.write('			<area shape="rect" coords="2,1,419,307" href="javascript:void(0)" οnclick="openZoosUrl(\'center_swt\');return false;">	');
document.write('			<area shape="rect" coords="191,308,419,342" href="javascript:void(0)" οnclick="openZoosUrl(\'center_swt\');return false;">	');
document.write('			<area shape="rect" coords="92,310,188,338" href="javascript:void(0)" οnclick="hide_center();return false;">	');
document.write('		</map>	');
document.write('	</div>	');
document.write('</div>	');


//隐藏左侧 QQ
function qq_hide()
{
	document.getElementById('qqBox').style.display = 'none';
}

//隐藏右侧 商务通
function hide_swt()
{
	document.getElementById('swtBox').style.display = 'none';
}

//隐藏中间部分 商务通
function hide_center()
{
	document.getElementById('centerBox').style.display = 'none';
	document.getElementById('swtBox').style.display = 'block';
}


//重新显示所有 广告
function show_swt()
{
	document.getElementById('qqBox').style.display = 'block';
	document.getElementById('swtBox').style.display = 'block';
	document.getElementById('centerBox').style.display = 'block';
}


//每个30秒执行一次
setInterval(show_swt,30000);


//这里可以放一些统计代码
document.writeln('<div style="display:none">');
document.writeln('');
document.writeln('</div>');

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值