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

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

請(qǐng)教一下 謝謝

請(qǐng)教一下 謝謝

qq_12月_0 2017-01-19 01:13:21
<html> <head> <meta?http-equiv="X-UA-Compatible"?content="IE=edge"/> <title>bing?search</title> <style?type="text/css"> *{margin:?0;padding:?0} body{background-color:?#333;} .bg-div{position:relative;background-image:?url(river.jpg);width:1228px;height:690px;margin:?0?auto;} .logo{background-image:?url(logo.png);height:53px;width:?107px;?float:?left;margin:?-4px?18px?0?0;} .search-form{float:?left;?background-color:?#fff;padding:5px;} .search-text{height:25px;line-height:?25px;float:?left;width:?350px;border:?0;outline:?none;} .search-button{background-image:?url(search-button.png);width:29px;height:29px;float:?left;border:?0;} .search-box{position:absolute;top:150px;left:?200px;?} .suggest{width:?388px;border:?1px?solid?#999;background-color:?#fff;position:?absolute;} .suggest?ul{list-style:?none;} .suggest?ul?li{line-height:?25px;padding:?3px;font-size:?14px;cursor:?pointer;} .suggest?ul?li:hover{background-color:?#e5e5e5;text-decoration:?underline;} </style> <script?type="text/javascript"?src="http://libs.baidu.com/jquery/2.1.4/jquery.min.js"></script> </head> <body> ?<div?class="bg-div"> ? <div?class="search-box"> ? <div?class="logo"></div> <form?class="search-form"?action="https://cn.bing.com/search"?target="_blank"?id="search-form"> <input?type="text"?class="search-text"?name="q"?id="search-input"?/> <input?type="submit"?class="search-button"?value=""?id="search-button"?/> </form> ? </div> ?</div> ?<div?class="suggest"?id="search-suggest"?style="display:?none;"> <ul?id="search-result"> <li>hah</li> <li>hah</li> <li>hah</li> <li>hah</li> <li>hah</li> <li>hah</li> </ul> </div> <script?type="text/javascript"> //?$("#search-input").on("keyup",function(){ //?var?searchText?=?$("#search-input").val(); //?$.get('http://api.bing.com/qsonhs.aspx?q='+searchText,function(d){ //?var?d=d.AS.Results[0].suggests; //?var?html=''; //?d.each(function(index,result){ //?html+='<li>'+result.Txt+'</li>'; //?$("#search-result").html(html); //?$("#search-suggest").show().css({ //?top:$("#search-form").offset().top+$("#search-form").outerHeight(), //?left:$("#search-form").offset().left //?}) //?}) //?},"json"); //?}) //?$(document).on("click",function(){ //?$("#search-suggest").hide() //?}) //?$(document).on("click","li",function(){ //?var?keyword=$(this).text(); //?location.+keyword; //?}) //獲得id元素 var?getDom=function(id){ return?document.getElementById(id); } //給id元素綁定事件 var?addEvent=function(id,event,fn){ var?elem=getDom(id)||document; if(elem.addEventListener){ elem.addEventListener(event,fn,false); }else?if(elem.attachEvent){ elem.attachEvent("on"+event,fn); }else{ elem["on"+event,fn]; } } var?getElementLeft=function(elem){ var?actuallf=elem.offsetLeft; var?parentelem=elem.offsetParent; while(parentelem!=null){ actuallf+=parentelem.offsetLeft; parentelem=parentelem.offsetParent; } return?actuallf; } var?getElementTop=function(elem){ var?actualtp=elem.offsetTop; var?parentelem=elem.offsetParent; while(parentelem!=null){ actualtp+=parentelem.offsetTop; parentelem=parentelem.offsetParent; } return?actualtp; } //?window.onload=function(){ //?}? window.onload=function(){ addEvent("search-input","keyup",function(){ getDom("search-suggest").style.top=getElementTop(getDom("search-form"))+38+"px"; getDom("search-suggest").style.left=getElementLeft(getDom("search-form"))+"px"; getDom('search-suggest').style.display?=?'block'; }) } </script> </body> </html>while(parentelem!=null){ actuallf+=parentelem.offsetLeft; parentelem=parentelem.offsetParent; } return?actuallf; }上面4行什么意思咯 ?actuallf+這是什么意思咯
查看完整描述

3 回答

已采納
?
weibo_哆啦A夢(mèng)有大口袋_0

TA貢獻(xiàn)107條經(jīng)驗(yàn) 獲得超146個(gè)贊

//和for循環(huán)有相同功能的還有while循環(huán),while循環(huán)重復(fù)執(zhí)行一段代碼,直到某個(gè)條件不再滿足。
//當(dāng)parentelem不等于null時(shí),
//actuallf+=parentelem.offsetLeft;????===????actuallf=actuallf+parentelem.offsetLeft;
//actuallf(更新的值)=actuallf(當(dāng)前的值)+parentelem.offsetLeft(元素距離瀏覽器左邊的距離);
//actuallf(2)=actuallf(假如等于1)+parentelem.offsetLeft(假如等于1);
//parentelem=parentelem.offsetParent;
//把parentelem(當(dāng)前)的父級(jí)賦值parentelem(更新的)
//也就是說(shuō)當(dāng)parentelem有父級(jí)時(shí),都滿足條件,當(dāng)parentelem沒(méi)有父級(jí)時(shí),parentelem(document)退出循環(huán)
while(parentelem!=null){
actuallf+=parentelem.offsetLeft;
parentelem=parentelem.offsetParent;
}
return?actuallf;
}

你的采納是對(duì)我的認(rèn)同和支持,O(∩_∩)O謝謝

查看完整回答
1 反對(duì) 回復(fù) 2017-01-19
?
葉0528

TA貢獻(xiàn)15條經(jīng)驗(yàn) 獲得超10個(gè)贊

actuallf+=parentelem.offsetLeft;

相當(dāng)于?actuallf=?actuallf + parentelem.offsetLeft; ?

查看完整回答
反對(duì) 回復(fù) 2017-01-19
  • 3 回答
  • 0 關(guān)注
  • 1620 瀏覽
慕課專欄
更多

添加回答

舉報(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)