随滚动条上下移动的flash代码
随滚动条上下移动的flash代码,或者层也可以,不过层要能插入flash。可以看看这个,类似这个的http://www.culer.cn/main越快越好...呵呵......
随滚动条上下移动的flash代码,或者层也可以,不过层要能插入flash。
可以看看这个,类似这个的http://www.culer.cn/main
越快越好...呵呵...3小时内解决追加200分。慢了就没了... 展开
可以看看这个,类似这个的http://www.culer.cn/main
越快越好...呵呵...3小时内解决追加200分。慢了就没了... 展开
展开全部
我给你一个好用的吧:
先是htm文件代码:将以下htm代码保存为banner.htm文件
----------------------------------
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<BODY leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<div id=divMenu style="Z-INDEX: 1; LEFT: 900px; WIDTH: 80px; POSITION: absolute; TOP: 84px; HEIGHT: 191px; background-color: #330033; layer-background-color: #330033; border: 1px none #000000;"> 45345 </div>
<script language=JavaScript src="scroll.js"></script>
<table width="778" height="1500" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="f4f4f4">
<tr>
<td> </td>
</tr>
</table>
</BODY></HTML>
------------------------------------
然后是scroll.js文件代码:
--------------------------------------
var bNetscape4plus = (navigator.appName == "Netscape" && navigator.appVersion.substring(0,1) >= "4");
var bExplorer4plus = (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.substring(0,1) >= "4");
function CheckUIElements(){
var yMenuFrom, yMenuTo, yButtonFrom, yButtonTo, yOffset, timeoutNextCheck;
if ( bNetscape4plus ) {
yMenuFrom = document["divMenu"].top;
yMenuTo = top.pageYOffset + 295;
}
else if ( bExplorer4plus ) {
yMenuFrom = parseInt (divMenu.style.top, 10);
yMenuTo = document.body.scrollTop + 135; //距页面顶部的距离
}
timeoutNextCheck = 500;
if ( Math.abs (yButtonFrom - (yMenuTo + 152)) < 6 && yButtonTo < yButtonFrom ) {
setTimeout ("CheckUIElements()", timeoutNextCheck);
return;
}
if ( yButtonFrom != yButtonTo ) {
yOffset = Math.ceil( Math.abs( yButtonTo - yButtonFrom ) / 10 );
if ( yButtonTo < yButtonFrom )
yOffset = -yOffset;
if ( bNetscape4plus )
document["divLinkButton"].top += yOffset;
else if ( bExplorer4plus )
divLinkButton.style.top = parseInt (divLinkButton.style.top, 10) + yOffset;
timeoutNextCheck = 10;
}
if ( yMenuFrom != yMenuTo ) {
yOffset = Math.ceil( Math.abs( yMenuTo - yMenuFrom ) / 20 );
if ( yMenuTo < yMenuFrom )
yOffset = -yOffset;
if ( bNetscape4plus )
document["divMenu"].top += yOffset;
else if ( bExplorer4plus )
divMenu.style.top = parseInt (divMenu.style.top, 10) + yOffset;
timeoutNextCheck = 10;
}
setTimeout ("CheckUIElements()", timeoutNextCheck);
}
function OnLoad()
{
var y;
if ( top.frames.length )
if ( bNetscape4plus ) {
document["divMenu"].top = top.pageYOffset + 135;
document["divMenu"].visibility = "visible";
}
else if ( bExplorer4plus ) {
divMenu.style.top = document.body.scrollTop + 235;
divMenu.style.visibility = "visible";
}
CheckUIElements();
return true;
}
OnLoad();
-------------------------------------
将以上js文件代码复制到记事本中并保存为scroll.js文件,然后将scroll.js文件与banner.htm文件放到同一目录中,双击banner.htm文件就可以看到你所说的随滚动条上下移动的banner效果了,想在banner中插入FLASH的话就用dw软件打开banner.htm文件然后在层中插入FLASH即可,我想你应该会的吧 ,哈哈 把分给我,记得要加200分哦!还有什么不明白的可以加我的百度hi 在交流。。。
先是htm文件代码:将以下htm代码保存为banner.htm文件
----------------------------------
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<BODY leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<div id=divMenu style="Z-INDEX: 1; LEFT: 900px; WIDTH: 80px; POSITION: absolute; TOP: 84px; HEIGHT: 191px; background-color: #330033; layer-background-color: #330033; border: 1px none #000000;"> 45345 </div>
<script language=JavaScript src="scroll.js"></script>
<table width="778" height="1500" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="f4f4f4">
<tr>
<td> </td>
</tr>
</table>
</BODY></HTML>
------------------------------------
然后是scroll.js文件代码:
--------------------------------------
var bNetscape4plus = (navigator.appName == "Netscape" && navigator.appVersion.substring(0,1) >= "4");
var bExplorer4plus = (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.substring(0,1) >= "4");
function CheckUIElements(){
var yMenuFrom, yMenuTo, yButtonFrom, yButtonTo, yOffset, timeoutNextCheck;
if ( bNetscape4plus ) {
yMenuFrom = document["divMenu"].top;
yMenuTo = top.pageYOffset + 295;
}
else if ( bExplorer4plus ) {
yMenuFrom = parseInt (divMenu.style.top, 10);
yMenuTo = document.body.scrollTop + 135; //距页面顶部的距离
}
timeoutNextCheck = 500;
if ( Math.abs (yButtonFrom - (yMenuTo + 152)) < 6 && yButtonTo < yButtonFrom ) {
setTimeout ("CheckUIElements()", timeoutNextCheck);
return;
}
if ( yButtonFrom != yButtonTo ) {
yOffset = Math.ceil( Math.abs( yButtonTo - yButtonFrom ) / 10 );
if ( yButtonTo < yButtonFrom )
yOffset = -yOffset;
if ( bNetscape4plus )
document["divLinkButton"].top += yOffset;
else if ( bExplorer4plus )
divLinkButton.style.top = parseInt (divLinkButton.style.top, 10) + yOffset;
timeoutNextCheck = 10;
}
if ( yMenuFrom != yMenuTo ) {
yOffset = Math.ceil( Math.abs( yMenuTo - yMenuFrom ) / 20 );
if ( yMenuTo < yMenuFrom )
yOffset = -yOffset;
if ( bNetscape4plus )
document["divMenu"].top += yOffset;
else if ( bExplorer4plus )
divMenu.style.top = parseInt (divMenu.style.top, 10) + yOffset;
timeoutNextCheck = 10;
}
setTimeout ("CheckUIElements()", timeoutNextCheck);
}
function OnLoad()
{
var y;
if ( top.frames.length )
if ( bNetscape4plus ) {
document["divMenu"].top = top.pageYOffset + 135;
document["divMenu"].visibility = "visible";
}
else if ( bExplorer4plus ) {
divMenu.style.top = document.body.scrollTop + 235;
divMenu.style.visibility = "visible";
}
CheckUIElements();
return true;
}
OnLoad();
-------------------------------------
将以上js文件代码复制到记事本中并保存为scroll.js文件,然后将scroll.js文件与banner.htm文件放到同一目录中,双击banner.htm文件就可以看到你所说的随滚动条上下移动的banner效果了,想在banner中插入FLASH的话就用dw软件打开banner.htm文件然后在层中插入FLASH即可,我想你应该会的吧 ,哈哈 把分给我,记得要加200分哦!还有什么不明白的可以加我的百度hi 在交流。。。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询