float.js

来自「低压断路器选型指南」· JavaScript 代码 · 共 52 行

JS
52
字号
var innerWidth = document.body.offsetWidth;var innerHeight = document.body.offsetHeight;var leftOff;document.ns = navigator.appName == "Microsoft Internet Explorer";if (document.ns){	leftOff = 130;}else{	leftOff = 110;}function myload(){	document.getElementById("followDiv1").style.top=parseInt(document.body.scrollTop)+"px";	document.getElementById("followDiv1").style.left=parseInt(parseInt(document.body.offsetWidth)+10)+"px";	document.getElementById("followDiv2").style.top=parseInt(document.body.scrollTop)+"px";	document.getElementById("followDiv2").style.left=parseInt(parseInt(document.body.offsetWidth)-130)+"px";	mymove();}function mymove(){	document.getElementById("followDiv1").style.top=parseInt(document.body.scrollTop)+"px";	document.getElementById("followDiv1").style.left=parseInt(parseInt(document.body.scrollLeft)+10)+"px";	document.getElementById("followDiv2").style.top=parseInt(document.body.scrollTop)+"px";	document.getElementById("followDiv2").style.left=parseInt(parseInt(document.body.scrollLeft)+parseInt(document.body.offsetWidth)-leftOff)+"px";	setTimeout("mymove();",50);}function MM_reloadPage(init){	if (init==true) with (navigator)	{		document.MM_pgW=innerWidth;		document.MM_pgH=innerHeight;		onresize=MM_reloadPage;	}	else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH)	{		location.reload();	}}MM_reloadPage(true);if(document.body.offsetWidth>800){	document.write("<div id='followDiv1' style='position: absolute;visibility: visible;z-index: 1'><iframe src=../ad/htm/1.asp width=120 height=300 frameborder=0 scrolling=no></iframe></div>");	document.write("<div id='followDiv2' style='position: absolute;visibility: visible;z-index: 1'><iframe src=../ad/htm/2.asp width=100 height=300 frameborder=0 scrolling=no></iframe></div>");	myload();}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?