php自动滚动播放新闻,腾讯新闻中心栏目焦点滚动效果

var dde_para = new Array();

var dde_aa   = new Array();

var dde_url  = document.location.href;

var dde_pp   = dde_url.split("#")[1];

var jspfile  = 1;

var para     = null;

//滚动页面的宽

var scrollwidth = 705;

//滚动页面的高

var scrollheight = 120;

if(dde_pp!=null && dde_pp.length>0){

dde_para = dde_pp.split("&");}

for(i=0; dde_para!=null && i

dde_aa = dde_para[i].split("=");

eval("var "+dde_aa[0] +"='"+dde_aa[1]+"'");}

var car_num = 5;

var i=1;

//默认滚动时间10秒

var pausebetweenp_w_picpaths=400 * 8;

var slidep_w_picpaths=new Array();

//滚动页面1的URL

slidep_w_picpaths[0]="";

//滚动页面2的URL

slidep_w_picpaths[1]="";

function move1(whichdiv){

tdiv=eval(whichdiv)

if (tdiv.style.pixelTop>0&&tdiv.style.pixelTop<=car_num){

tdiv.style.pixelTop=0

setTimeout("move1(tdiv)",pausebetweenp_w_picpaths)

setTimeout("move2(second2)",pausebetweenp_w_picpaths)

return}

if (tdiv.style.pixelTop>=tdiv.offsetHeight*-1){

tdiv.style.pixelTop-=car_num

setTimeout("move1(tdiv)",50)}

else{

tdiv.style.pixelTop=scrollheight

tdiv.innerHTML=slidep_w_picpaths[0]

if (i==slidep_w_picpaths.length-1)

i=0

else i++}}

function move2(whichdiv){

tdiv2=eval(whichdiv)

if (tdiv2.style.pixelTop>0&&tdiv2.style.pixelTop<=car_num){

tdiv2.style.pixelTop=0

setTimeout("move2(tdiv2)",pausebetweenp_w_picpaths)

setTimeout("move1(first2)",pausebetweenp_w_picpaths)

return}

if (tdiv2.style.pixelTop>=tdiv2.offsetHeight*-1){

tdiv2.style.pixelTop-=car_num

setTimeout("move2(second2)",50)}

else{

tdiv2.style.pixelTop=scrollheight

tdiv2.innerHTML=slidep_w_picpaths[1]

if (i==slidep_w_picpaths.length-1)

i=0

else i++}}

function conmouse(){car_num=0;}

function cmouseout(){car_num=5;}

function startscroll(){

if (document.all){

move1(first2)

second2.style.top=scrollheight

}

else if (document.layers){

move1(document.main.document.first)

document.main.document.second.top=scrollheight+5

document.main.document.second.visibility='show'}}

//-->

width="&{scrollwidth};">

top="1" width="&{scrollwidth};" id=first>

if (document.layers)

document.write(slidep_w_picpaths[0])

visibility="hide">

if (document.layers)

document.write(slidep_w_picpaths[1])

if (document.all){

document.writeln('')

document.writeln('

')

document.writeln('

')

document.write(slidep_w_picpaths[0])

document.writeln('

')

document.writeln('

')

document.write(slidep_w_picpaths[1])

document.writeln('

')

document.writeln('

')

document.writeln('')}

startscroll();

查找更多代码,请访问:懒人图库

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值