>  기사  >  php教程  >  javascript 控制图片播放

javascript 控制图片播放

WBOY
WBOY원래의
2016-06-06 20:01:331110검색

!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으로 문의하세요.