这段代码在ie里可以显示浮动随滚动条滚动的效果,但在firefox不能实现这个效果,怎样改才行
<SCRIPT language=javascript>
<!--
var stmnLEFT = 0; //
var stmnGAP1 = 115; // 初始位置
var stmnGAP2 = 150; //
var stmnGAP1 = 115; // 初始位置
var stmnActivateSpeed = 200;
var stmnScrollSpeed = 10;
var stmnTimer;
var flag = false;
function ImgClick()
{
if(flag)
{
sc.src="pixel.gif";
flag = false;
}
else
{
sc.src="pixel.gif";
flag = true;
}
ToggleAnimate();
}
function RefreshStaticMenu()
{
var stmnStartPoint, stmnEndPoint, stmnRefreshTimer;
stmnStartPoint = parseInt(STATICMENU.style.top, 10);
stmnEndPoint = document.documentElement.scrollTop + stmnGAP2;
if (stmnEndPoint < stmnGAP1) stmnEndPoint = stmnGAP1;
stmnRefreshTimer = stmnActivateSpeed;
if ( stmnStartPoint != stmnEndPoint ) {
stmnScrollAmount = Math.ceil( Math.abs( stmnEndPoint - stmnStartPoint ) / 15 );
STATICMENU.style.top = parseInt(STATICMENU.style.top, 10) + ( ( stmnEndPoint<stmnStartPoint ) ? -stmnScrollAmount : stmnScrollAmount );
stmnRefreshTimer = stmnScrollSpeed;
}
stmnTimer = setTimeout ("RefreshStaticMenu();", stmnRefreshTimer);
}
function ToggleAnimate()
{
if (flag) {
RefreshStaticMenu();
}
else {
clearTimeout(stmnTimer);
STATICMENU.style.top = stmnGAP1;
}
}
//-->
</SCRIPT>