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

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

關(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是一個參數(shù)嗎?為什么去掉之后就運行不出結(jié)果,代碼里面e的具體作用是什么定義參數(shù)的時候什么時候需要定義function() 什么時候需要定義funciton(e)?求解答
查看完整描述

1 回答

?
紫羅天

TA貢獻12條經(jīng)驗 獲得超4個贊

event?對象,包含一些屬性信息,具體的可以百度js事件。至于為什么去掉e不行,是因為你在里面用到了e.stopPropagation(),這個是阻止事件冒泡 (這個我也不怎么懂)

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

添加回答

舉報

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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