下面是JS腳本(floatdiv
/*======================================================================
浮動塊支持腳本
DESIGN BY : 彭國輝
DATE:
SITE:
EMAIL:
======================================================================*/
var alLeft =
var alTop =
var f = new Array();
var cnt =
function floatDiv(objId
{
/*浮動塊對象
數據結構
objId
align
vAlign
x
smooth
*/
this
this
this
this
this
this
}
function addDiv(objId
{ //添加浮動塊
f[cnt++] = new floatDiv(objId
}
function floatMove()
{ //重新定位各塊位置
var objX
if (document
{
var d = document
//status =
for (var i=
{
switch (f[i]
{
case alLeft : objX = d
case alCenter: objX = d
case alRight : objX = d
}
switch (f[i]
{
case alTop : objY = d
case alMiddle: objY = d
case alBottom: objY = d
}
if (f[i]
else
{
f[i]
f[i]
}
}
}
if (document
{
for (var i=
{
var objId = f[i]
switch (f[i]
{
case alLeft : objX = pageXOffset + f[i]
case alCenter: objX = pageXOffset + Math
case alRight : objX = pageXOffset + window
}
switch (f[i]
{
case alTop : objY = pageYOffset + f[i]
case alMiddle: objY = pageYOffset + Math
case alBottom: objY = pageYOffset + window
}
if (t[i]
else
{
document
document
}
}
}
setTimeout(
}
function smoothMove(obj
{
var percent;
if (document
{
percent =
if (percent >
obj
percent =
if (percent >
obj
}
if (document
{
percent =
if (percent >
document
percent =
if (percent >
document
}
}
setTimeout(
調用例子
<script language=
<script language=
if (navigator
{
document
}
else
{
document
}
addDiv(ad_hr
</script>
From:http://tw.wingwit.com/Article/program/Java/JSP/201311/19414.html