第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

<!doctype html>

<html>

<head>

<meta charset="utf-8">

<title>焦點(diǎn)輪播圖</title>

<style>

*{margin:0; padding:0}

img{border:0; vertical-align:bottom}

a{text-decoration:none}

#container{width:600px; height:400px; border:1px solid #333; overflow:hidden; position:relative; margin:30px auto}

#list{width:4200px; height:400px; position:absolute}

#list img{float:left}

#buttons{ height:10px; width:100px; position:absolute; bottom:20px; left:250px}

#buttons span{ width:8px; height:8px; float:left; border-radius:5px; border:1px #fff solid; margin:0 10px 0 0}

#buttons .on{background:#fff}

.arrow{cursor:pointer; line-height:39px; text-align:center; font-size:36px; position:absolute; font-weight:bold; top:170px; color:#fff; display:block; width:35px; border-radius:5px; display:none}

.arrow:hover{background-color:RGBA(0,0,0,.5)}

#container:hover .arrow{display:block;}

#prev{left:20px}

#next{right:20px}

</style>

<script>

window.onload=function(){

var container=document.getElementById("container");

var list=document.getElementById("list");

var buttons=document.getElementById("buttons").getElementsByTagName("span");

var prev=document.getElementById("prev");

var next=document.getElementById("next");

var index=1;//小圓點(diǎn)位置

var animated=false;//判斷是否在運(yùn)行animat函數(shù)

var timer;

//改變小圓點(diǎn)的當(dāng)前顏色

function showButton(){

for(var i=0; i<buttons.length; i++){

buttons[i].className='';

}

buttons[index-1].className='on';

}

//切換圖片(判斷第一張和最后一張?zhí)厥獾奈恢茫琽ffset每次切換的數(shù)值

function animate(offset){//

animated=true;

var newLeft=parseInt(list.style.left)+offset;

var time=300;//位移總時(shí)間

var interval=10;//位移間隔時(shí)間

var speed=offset/ (time/interval);//每次位移量(負(fù)數(shù):向左; 正數(shù):向右)

function go(){

if((speed<0 && parseInt(list.style.left)>newLeft) || (speed>0 && parseInt(list.style.left) < newLeft)){

list.style.left=parseInt(list.style.left)+speed+'px';

setTimeout(go,interval);//調(diào)自己的函數(shù),即遞歸

}

else{

animated = false;

list.style.left = newLeft+'px';

if(newLeft > -600){//img1的位置

list.style.left = -3000 + 'px';

}

if(newLeft < -3000){//img2的位置

list.style.left = -600 + 'px';

}

}

}

go();


}

function play(){

timer=setInterval(function(){

next.onclick();

},3000);

}

function stop(){

clearInterval(timer);

}

play();

container.onmouseover = stop;

container.onmouseout = play;

next.onclick=function(){

if(index==5){

index=1;

}else{

index+=1;

}

showButton();

if(!animated){

animate(-600);

}

}

prev.onclick=function(){

if(index==1){

index=5;

}else{

index-=1;

}

showButton();

if(!animated){

animate(600);

}

}

for(var i=0; i<buttons.length; i++){

buttons[i].onclick=function(){

if(this.className=='on'){//當(dāng)點(diǎn)擊當(dāng)前圖片的小圖標(biāo),return退出當(dāng)前函數(shù)

return;

}

//獲取當(dāng)前點(diǎn)擊時(shí)屬性里的Index值

var myIndex=parseInt(this.getAttribute('index'));//獲取自定義屬性或dom自帶屬性

var offset=-600*(myIndex-index);

if(!animated){

animate(offset);

}

index=myIndex;

showButton();

}

}

}

</script>

</head>


<body>

<div id="container">

<div id="list" style="left:-600px">

    <img src="images/5.jpg" alt=""/>

        <img src="images/1.jpg" alt=""/>

        <img src="images/2.jpg" alt=""/>

        <img src="images/3.jpg" alt=""/>

        <img src="images/4.jpg" alt=""/>

        <img src="images/5.jpg" alt=""/>

        <img src="images/1.jpg" alt=""/>

    </div>

    <div id="buttons">

    <span index="1" class="on"></span>

        <span index="2" ></span>

        <span index="3" ></span>

        <span index="4" ></span>

        <span index="5" ></span>

    </div>

    <a href="javascript:;" id="prev" class="arrow"><</a>

  <a href="javascript:;" id="next" class="arrow">></a>

</div>

</body>

</html>


正在回答

1 回答

贊一個(gè)!

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)