Home > php教程 > php手册 > body text

javascript 控制图片播放

WBOY
Release: 2016-06-06 20:01:33
Original
1160 people have browsed it

!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();

 

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template