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

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

關(guān)于function(e)的疑惑

關(guān)于function(e)的疑惑

ken0510 2016-08-13 15:37:13
<!DOCTYPE html><html><head>? <style>p { margin-left:10px; color:blue; width:200px;? ? cursor:pointer; }span { color:red; cursor:pointer; }div.abs { width:50px; height:50px; position:absolute;? ? ? ? ? left:220px; top:35px; background-color:green;? ? ? ? ? cursor:pointer; }? </style>? <script src="http://code.jquery.com/jquery-latest.js"></script></head><body>? <div id="result">Click an element.</div><p>? This is the best way to <span>find</span> an offset.</p>?<div class="abs"></div>?<script>$("*", document.body).click(function (e) {? var offset = $(this).offset();? e.stopPropagation();? $("#result").text(this.tagName + " coords ( " + offset.left + ", " +? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? offset.top + " )");});?</script>?</body></html>代碼里面function(e)里面的e是一個(gè)參數(shù)嗎?為什么去掉之后就運(yùn)行不出結(jié)果,代碼里面e的具體作用是什么定義參數(shù)的時(shí)候什么時(shí)候需要定義function() 什么時(shí)候需要定義funciton(e)?求解答
查看完整描述

1 回答

?
紫羅天

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

event?對(duì)象,包含一些屬性信息,具體的可以百度js事件。至于為什么去掉e不行,是因?yàn)槟阍诶锩嬗玫搅薳.stopPropagation(),這個(gè)是阻止事件冒泡 (這個(gè)我也不怎么懂)

查看完整回答
反對(duì) 回復(fù) 2016-08-13
  • 1 回答
  • 0 關(guān)注
  • 1291 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號(hào)

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