首页  >  文章  >  php教程  >  javascript 控制图片播放

javascript 控制图片播放

WBOY
WBOY原创
2016-06-06 20:01:331153浏览

!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" html xmlns="http://www.w3.org/1999/xhtml" head meta http-equiv="Content-Type" content="text/html; charset=utf-8" / titl

 

无标题文档

img {border:0;}

.photo {width:310px;height:280px;border-top:0;border-right:2px solid #9f9fa1;border-bottom:1px solid #9f9fa1;border-left:2px solid #9f9fa1;font-size:12px;}

.photo .left {width:310px;height:222px;margin:0 5px;}

.photo .left img {width:310px;height:250px;}

.photo ul li {float:left;list-style-type:none;width:140px;height:135px;}

.photo ul li img {width:130px;height:115px;border:1px solid #999;}

.photo ul li div {line-height:19px;height:19px;overflow:hidden;}

#fc {filter:progid:DXImageTransform.Microsoft.Fade (duration=0.5,overlap=1.0);}

#con,#num {height:20px;line-height:20px;overflow:hidden;}

#con {float:left;width:200px;text-align:center;}

#num {float:right;width:110px;}

#num span {cursor:pointer;width:15px;height:15px;display:block;float:left;margin:0 1px;line-height:16px;overflow:hidden;margin-top:2px;text-align:center;}

.bigon{background:url("numon.gif");color:#fff;} /*长为15px 宽为15px*/

.bigoff{background:url("numoff.gif");color:#000;}

 

        

 

 

 

kshot.js文件

 

 

 

var n=0;

var showNum = document.getElementById("num");

var showNums = document.getElementById("num").getElementsByTagName("span");

function Mea(value){

n=value;

setBg(value);

plays(value);

cons(value);

}

function setBg(value){

for(var i=0;i

   if(value==i){

showNum.getElementsByTagName("span")[i].className='bigon';

else{

showNum.getElementsByTagName("span")[i].className='bigoff';

}  

function plays(value){

try

{

with (fc)

{

filters[0].Apply();

for(i=0;i

filters[0].play(); 

}

}

catch(e)

{

var divlist = document.getElementById("fc").getElementsByTagName("div");

for(i=0;i

{

i==value?divlist[i].style.display="block":divlist[i].style.display="none";

}

}

}

function cons(value){

try

{

with (con)

{

for(i=0;i

}

}

catch(e)

{

var divlist = document.getElementById("con").getElementsByTagName("div");

for(i=0;i

{

i==value?divlist[i].style.display="block":divlist[i].style.display="none";

}

}

}

 

function setAuto(){autoStart=setInterval("auto(n)", 5000)}

function clearAuto(){clearInterval(autoStart)}

 

function auto(){

n++;

if(n>showNums.length-1)n=0;

Mea(n);

function sub(){

n--;

if(n

Mea(n);

}

setAuto();

 

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn