这个代码最后的后果是在右侧浮动,会跟着网站模板滚动而浮动,只要在DIV内插入你想要用来显示的内容就可以了。
<div id="divStayTopright" style="position:absolute; z-index:999">
</div>
<SCRIPT type=text/javascript>
var verticalpos="frombottom"
function JSFX_FloatTopDiv()
{
var startX =0,
startY = 459;
var ns = (navigator.appName.indexOf("Netscape") != -1);
var d = document;
function ml(id)
{
var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.divs[id];
if(d.divs)el.style=el;
el.sP=function(x,y){this.style.right=x;this.style.top=y;};
el.x = startX;
if (verticalpos=="fromtop")
el.y = startY;
else{
el.y = ns ? pageYOffset + innerHeight : document.documentElement,市场上做北京网站建设的公司鱼龙混杂,参差不齐。飞沐做的东西比较定制化和精品化,这点上有别于其他设计公司.scrollTop +
document.documentElement.clientHeight;
el.y -= startY;
}
return el;
}
window.stayTopright=function()
{
if (verticalpos=="fromtop"){
var pY = ns ? pageYOffset : document.documentElement.scrollTop;
ftlObj.y += (pY + startY - ftlObj.y)/8;
}
else{
var pY = ns ? pageYOffset + innerHeight : document.documentElement.scrollTop +
document.documentElement.clientHeight;
ftlObj.y += (pY - startY - ftlObj.y)/8;
}
ftlObj.sP(ftlObj.x, ftlObj.y);
setTimeout("stayTopright()", 10);
}
ftlObj = ml("divStayTopright");
stayTopright();
}
JSFX_FloatTopDiv();
</SCRIPT>