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

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

為什么這個(gè) ”點(diǎn)擊回到頂部按鈕后 滑動(dòng)滑輪的效果“ 在 IE可以 在chrom 里不行

window.onload = function(){

var hiee = document.documentElement.clientHeight;

var timer=null;

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

var isT = true;

window.onscroll = function(){

var ttop = document.documentElement.scrollTop || document.body.scrollTop;

if(ttop >= hiee){

btn.style.display= "block";

}else{

btn.style.display= "none";

}

if(!isT){

clearInterval(timer);

}

isT = false;

}

btn.onclick = function(){

timer = setInterval(function(){

var ttop = document.documentElement.scrollTop||document.body.scrollTop;

var ispeed = Math.floor(-ttop / 6);

document.documentElement.scrollTop = document.body.scrollTop = ispeed +ttop;

//document.documentElement.scrollTop = document.body.scrollTop = ttop - ttop/50;

// = function(){clearInterval(timer)}

isT = true;

if( ttop == 0){

clearInterval(timer)

}

},10)

}

}


正在回答

3 回答

http://img1.sycdn.imooc.com//5684f89d0001898f05680063.jpg

看看是不是沒(méi)有空格的原因

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

是不是有瀏覽器兼容問(wèn)題

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

qq_e累_0 提問(wèn)者

對(duì) 有
2015-11-28 回復(fù) 有任何疑惑可以回復(fù)我~
<!DOCTYPE?html>
<html?lang="en">
<head>
????<meta?charset="UTF-8">
????<title>Title</title>
????<style>
?#btn?{
?width:40px;
?height:40px;
?position:fixed;
?left:50%;
?display:none;
?margin-left:610px;
?bottom:30px;
?background:url(http://img1.sycdn.imooc.com//535e0dc100010e9c00400080.jpg)?no-repeat?left?top;
????????}
?#btn:hover?{
?background:url(http://img1.sycdn.imooc.com//535e0dc100010e9c00400080.jpg)?no-repeat?0?-39px;
????????}
????????.box?{
?width:1190px;
?margin:0?auto;
????????}
?</style>
</head>
<body>
<div?class="box">
????<img?src="http://img1.sycdn.imooc.com//535e0ce800015b7511902787.jpg"/>
</div>
<a?href="javascript:;"?id="btn"?title="回到頂部"></a>
<script>
?window.onload?=?function?()?{
?var?hiee?=?document.documentElement.clientHeight;
?var?timer?=?null;
?var?btn?=?document.getElementById("btn");
?var?isT?=?true;
?window.onscroll?=?function?()?{
?var?ttop?=?document.documentElement.scrollTop?||?document.body.scrollTop;
?if?(ttop?>=?hiee)?{
?btn.style.display?=?"block";
????????????}?else?{
?btn.style.display?=?"none";
????????????}
?if?(!isT)?{
?clearInterval(timer);
????????????}
?isT?=?false;
????????}
?btn.onclick?=?function?()?{
?timer?=?setInterval(function?()?{
?var?ttop?=?document.documentElement.scrollTop?||?document.body.scrollTop;
?var?ispeed?=?Math.floor(-ttop?/?6);
?document.documentElement.scrollTop?=?document.body.scrollTop?=?ispeed?+?ttop;
//document.documentElement.scrollTop?=?document.body.scrollTop?=?ttop?-?ttop/50;
//?=?function(){clearInterval(timer)}
?isT?=?true;
?if?(ttop?==?0)?{
?clearInterval(timer)
????????????????}
????????????},?10)
????????}
????}
</script>
</body>
</html>

谷歌里可以的

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

qq_e累_0 提問(wèn)者

chrom里不可以 就是 滾動(dòng)條自動(dòng)向上滑時(shí) 滑動(dòng)鼠標(biāo)滑輪 沒(méi)有清除定時(shí)器 同學(xué)的代碼 在chrom也可以
2015-11-27 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消
回到頂部效果
  • 參與學(xué)習(xí)       44202    人
  • 解答問(wèn)題       212    個(gè)

回到頂部網(wǎng)站不可缺少的一部分,用JS實(shí)現(xiàn)炫酷拉風(fēng)的回到頂部效果

進(jìn)入課程

為什么這個(gè) ”點(diǎn)擊回到頂部按鈕后 滑動(dòng)滑輪的效果“ 在 IE可以 在chrom 里不行

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

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

幫助反饋 APP下載

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

公眾號(hào)

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