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

為了賬號安全,請及時綁定郵箱和手機立即綁定

切換頁面一段時間后,再切回來輪播圖使勁滾!

切換頁面一段時間后,再切回來輪播圖使勁滾!求大神幫忙解決,快快。拜托

正在回答

4 回答

<!doctype?html>
<html?lang="en">
<head>
????<meta?charset="UTF-8">
????<title>Document</title>
????<style>
?*?{
????????????margin:?0;
?padding:?0;
?}
????????ul?li?{
????????????list-style:?none;
?float:?left;
?/*display:?none;*/
?}
????????ul?li?a?{
????????????draggable:?false;
?}
????????img?{
????????????vertical-align:?top;
?draggable:?false;
?-webkit-tap-highlight-color:transparent;
?}
????????#box?{
????????????position:?relative;
?width:?520px;
?height:?280px;
?border:?1px?solid?#666;
?/*padding:?5px;*/
?margin:?200px?auto;
?overflow:?hidden;
?}
????????#slider?{
????????????width:?520px;
?height:?280px;
?position:?relative;
?}
????????ul?{
????????????width:?1000%;
?position:?absolute;
?left:?0;
?top:?0;
?}
????????ol?{
????????????/*width:?200px;*/
????????????/*height:?20px;*/
?position:?absolute;
?left:?50%;
?bottom:?20px;
?transform:?translateX(-50%);
?}
????????ol?li?{
????????????float:?left;
?list-style:?none;
?width:?20px;
?height:?20px;
?border-radius:?50%;
?background-color:?silver;
?color:?#fff;
?text-align:?center;
?margin:?5px;
?cursor:?pointer;
?-webkit-touch-callout:?none;?/*?iOS?Safari?*/
?-webkit-user-select:?none;?/*?Chrome/Safari/Opera?*/
?-khtml-user-select:?none;?/*?Konqueror?*/
?-moz-user-select:?none;?/*?Firefox?*/
?-ms-user-select:?none;?/*?Internet?Explorer/Edge?*/
?user-select:?none;?/*?Non-prefixed?version,?currently
?????????not?supported?by?any?browser?*/

?}
????????.current?{
????????????background-color:?orange;
?}
????</style>
</head>
<body>
????<div?id="box">
????????<div?id="slider">
????????????<ul>
????????????????<li><a?href=""?ondragstart='return?false;'><img?src="images/01.jpg"?alt=""/></a></li>
????????????????<li><a?href=""><img?src="images/02.jpg"?alt=""/></a></li>
????????????????<li><a?href=""><img?src="images/03.jpg"?alt=""/></a></li>
????????????????<li><a?href=""><img?src="images/04.jpg"?alt=""/></a></li>
????????????????<li><a?href=""><img?src="images/05.jpg"?alt=""/></a></li>
????????????</ul>
????????</div>
????</div>
</body>
<script>
//????document.ondragstart=function(e){
//????????e.preventDefault();
//????????return?false;
//????}
//
//????document.onselectionchange?=function(e){
//????????e.preventDefault();
//????????return?false;
//????}


?let?box?=?document.getElementById("box");
?let?slider?=?document.getElementById("slider");
?let?ul?=?slider.children[0];
?ul.appendChild(ul.children[0].cloneNode(true));
?let?ulLis?=?ul.children;
?let?ol?=?document.createElement("ol");
?box.appendChild(ol);
?for?(?let?i?=?0;?i?<?ulLis.length?-?1;?i++)?{
?let?li?=?document.createElement("li");
?ol.appendChild(li);
?li.innerText?=?i?+?1;
????}
?let?olLis?=?ol.children;
?olLis[0].className?=?"current";
?function?animate(obj,?target)?{
?if(obj.timer){
?clearInterval(obj.timer);
????????}
?let?speed?=?target?>?obj.offsetLeft???10?:?-10;
?obj.timer?=?setInterval(function()?{
?obj.style.left?=?obj.offsetLeft?+?speed?+?"px";
?let?result?=?target?-?obj.offsetLeft;
?if(Math.abs(result)?<=?10)?{
?clearInterval(obj.timer);
?obj.style.left?=?target?+?"px";
????????????}

????????},?10)
????}
?for?(let?i?=?0;?i?<?olLis.length;?i++)?{
?olLis[i].index?=?i;
?olLis[i].onclick?=?function?()?{
?for?(let?i?=?0;?i?<?olLis.length;?i++)?{
?olLis[i].className?=?"";
????????????}
?this.className?=?"current";

?animate(ul,?-this.index?*?520);
//????????????ul.style.left=-this.index?*?520+'px';
?squre?=?key?=?this.index;
????????}
????}
?let?timer?=?null;
?let?key?=?0;
?let?squre?=?0;
?timer?=?setInterval(autoplay,1000);
?document.addEventListener('visibilitychange',function(){?//瀏覽器切換事件
?if(document.visibilityState=='hidden')?{?//狀態(tài)判斷
//????????????????timer?=?null;
?clearInterval(timer);

????}else?{
?timer?=?setInterval(autoplay,1000);
//????????key++;
////????????alert(key,squre);
//????????????timer;
//????????if?(key?>?ulLis.length?-?1)?{
//????????????ul.style.left?=?0;
//????????????key?=?1;
//????????}
//????????animate(ul,?-key?*?520);
//????????squre++;
//????????if?(squre?>?olLis.length?-1)?{
//????????????squre?=?0;
//????????}
//????????for?(let?i?=?0;?i?<?olLis.length;?i++)?{
//????????????olLis[i].className?=?"";
//????????}
//????????olLis[squre].className?=?"current";

?}
});

document.addEventListener('visibilitychange',function()?{?//瀏覽器切換事件
?if?(document.visibilityState?==?'visible')?{?//狀態(tài)判斷
//????????????????timer?=?null;
?timer;

????}
})






?function?autoplay?()?{
//????????console.log(1);
//????????let?jilu?=?location.href;
//????????if?(location.href?!==?jilu)?{
//????????????return;
//????????}
?key++;
?if?(key?>?ulLis.length?-?1)?{
?ul.style.left?=?0;
?key?=?1;
????????}
?animate(ul,?-key?*?520);
?squre++;
?if?(squre?>?olLis.length?-1)?{
?squre?=?0;
????????}
?for?(let?i?=?0;?i?<?olLis.length;?i++)?{
?olLis[i].className?=?"";
????????}
?olLis[squre].className?=?"current";
????}

?box.onmouseover?=?function()?{
?clearInterval(timer);
????}
?box.onmouseout?=?function?()?{
?timer?=?setInterval(autoplay,?1000);
????}
slider.ondragstart?=?function?()?{
?return?false;
}
//????window.onload?=?function?()?{
////????????clearInterval(obj.timer);
//????????ul.style.display?=?"show";
//????}




</script>
</html>
css和js都在一個頁面上寫著,html結(jié)構(gòu)中的圖片路徑自己改一下應(yīng)該就能看到效果了


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

把定時器清除,只留下一個定時器。

var play;

? ? ? if(play){

? ? ? ?clearInterval(play);

? ? ? ?play=null;

? ? ? }


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

我也是這個問題的樣子??!你解決沒??!

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

rainy_li3676598

把你代碼發(fā)給我看一下, 我的已經(jīng)解決了
2016-12-06 回復(fù) 有任何疑惑可以回復(fù)我~

代碼呢?


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

舉報

0/150
提交
取消

切換頁面一段時間后,再切回來輪播圖使勁滾!

我要回答 關(guān)注問題
微信客服

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

幫助反饋 APP下載

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

公眾號

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