左栏浮动广告
<script language=javascript>var specialcode="<DIV id=searchspe style='Z-INDEX: <script language=javascript>var specialcode="<DIV id=searchspe style='Z-INDEX: 100; right: 1px; POSITION: absolute; TOP: 180px;'><TABLE cellSpacing=0 cellPadding=0 width=150 style='border-left:1px solid #2E6287;border-top:1px solid #2E6287;border-right:1px solid #2E6287;font-size:12px;color:#ffffff; border-bottom-color:#2E6287; border-bottom-width:1px'><TR bgcolor=#2E6287><TD height=20> 推荐↓</TD><TD style='CURSOR: hand' onclick=searchspe.style.visibility='hidden' width=30>关 闭</TD></TR></TABLE><table border='1' width='150' height='500' bordercolor='#2E6287'><tr><td>广告内容</td></tr></table></DIV>";document.write(specialcode);lastScrollY=0;function heartBeat0(){diffY=document.body.scrollTop;percent=.1*(diffY-lastScrollY);if(percent>0)percent=Math.ceil(percent);else percent=Math.floor(percent);document.all.searchspe.style.pixelTop+=percent;lastScrollY=lastScrollY+percent;}window.setInterval("heartBeat0()",1);</script>
右栏浮动广告
<script language=javascript>var specialcode="<DIV id=searchspe style='Z-INDEX: 100; left: 1px; POSITION: absolute; TOP: 50px;'><TABLE cellSpacing=0 cellPadding=0 width=360 style='border-left:1px solid #333333;border-top:1px solid #333333;border-right:1px solid #333333;font-size:12px;color:#ffffff'><TR bgcolor=#2E6287><TD height=20> 推荐↓</TD><TD style='CURSOR: hand' onclick=searchspe.style.visibility='hidden' width=30>关 闭</TD></TR></TABLE><table border='1' width='150' id='table1' bordercolor='#2E6287' height='500'><tr><td>广告内容</td></tr></table></DIV>";document.write(specialcode);lastScrollY=0;function heartBeat0(){diffY=document.body.scrollTop;percent=.1*(diffY-lastScrollY);if(percent>0)percent=Math.ceil(percent);else percent=Math.floor(percent);document.all.searchspe.style.pixelTop+=percent;lastScrollY=lastScrollY+percent;}window.setInterval("heartBeat0()",1);</script>
首先新建一个js文件,命名为:ad_right.js
把下面的代码复制到js文件里
lastScrollY2=0;
function heartBeat2(){
var diffY2;
if (document.documentElement && document.documentElement.scrollTop)
diffY2 = document.documentElement.scrollTop;
else if (document.body)
diffY2 = document.body.scrollTop
else
{/*Netscape stuff*/}
percent2=.1*(diffY2-lastScrollY2);
if(percent2>0)percent2=Math.ceil(percent2);
else percent2=Math.floor(percent2);
document.getElementById("PC_Right").style.top=parseInt(document.getElementById("PC_Right").style.top)+percent2+"px";
lastScrollY2=lastScrollY2+percent2; }
floatHTML='<DIV id="PC_Right" style="right:5px;POSITION:absolute;TOP:225px;z-index:6"><a href=""><img src="images/quick.gif" height="68" width="135" border="0"></a></div>'
document.write(floatHTML)
window.setInterval("heartBeat2()",1);
再在你要图片随滚动条滚动的网页中复制以下代码就可以了
<script language="javascript" src="ad_right.js"></script>
记住是复制到</body></html>的上面一行
平时我可以用JS实现。
1、插入层
2、在层中插入表格,表格中插入图像
3、在“层编号”中输入divMenu,清楚“z轴”的数字,在“显示”下拉列表中选择visible
4、在代码视图下,在层代码<div>…</div>后面插入代码:
<script src="images/common.js"></script>
当然已经有JS文件了,就是想不用JS文件代码可以实现么?
以下是javascript代码片段:
<div id="oLayer" style="position:absolute;left:5;top:100;"><img src=http://nsm.cc/img/logo.gif>
</div>
<script>
//document.write(new Array(100).join("<br>"))
var init_pos=oLayer.style.posTop
document.body.onscroll=function(){
oLayer.style.posTop=document.body.scrollTop+init_pos
}
</script>
本文来自爱秋天电脑教程网 http://www.loveqiutian.cn, 本文地址:http://www.loveqiutian.cn/bencandy.php?aid=60905
<DIV style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; ; RIGHT:
expression(eval(document.body.scrollLeft)+eval(document.body.clientWidth)-800); FILTER:
progid:DXImageTransform.Microsoftpadding:8px; BORDER-LEFT: medium none; BORDER-BOTTOM:
medium none; POSITION: absolute; ; TOP:
expression(eval(document.body.scrollTop)+eval(document.body.clientHeight)-500); TEXT-ALIGN:
center"><EMBED src=flash图片地址 width=100 height=120 type=application/x-shockwave-flash></DIV>
说明:
(document.body.clientWidth)-800); 表示被定位物体的左右位置,负数值越大距离左侧越远,可自行调节;(document.body.clientHeight)-500); 表示被定位物体的上下位置,负数值越大距离下方越远,可自行调节,;scrollAmount=1 scrollDelay=1 也就是滚动速度,数值越大滚动越快,可自行数值;
width=100 height=120 是图片宽高数值,可自行调节;
没有合适的资源?快使用搜索试试~ 我知道了~
怎样在网页中实现flash随滚动条滚动的代码
资源详情
资源评论
资源推荐
收起资源包目录
FLASH.rar (1个子文件)
滚动的FLASH.txt 4KB
共 1 条
- 1
hbmibo
- 粉丝: 0
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0