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

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

2個(gè)疑問(wèn)??

? 1.

? ? ?

//點(diǎn)擊更新次數(shù)

? ? $("button:first").click(function(event,bottonName) {

? ? ? ? bottonName = bottonName || 'first';

? ? ? ? update($("span:first"),$("span:last"),bottonName);

? ? });


? ? //通過(guò)自定義事件調(diào)用,更新次數(shù)

? ? $("button:last").click(function() {

? ? ? ? $("button:first").trigger('click','last');

? ? });


? ? function update(first,last,bottonName) {

? ? ? ? first.text(bottonName);

? ? ? ? var n = parseInt(last.text(), 10);

? ? ? ? last.text(n + 1);

? ? }

$("button:first").trigger('click','last'); ?里面的'last'為什么是傳給?bottonName,而不是function update(first,last,bottonName)里的last?


2.去掉代碼

? ? ?

$("button:first").click(function(event,bottonName) {

? ? ? ? bottonName = bottonName || 'first';

? ? ? ? update($("span:first"),$("span:last"),bottonName);

? ? });

為什么效果不對(duì)?

正在回答

4 回答

1.這個(gè)last是他自己定義的參數(shù),對(duì)應(yīng)function中的(bottomName)。而update里的last,其實(shí)是 $("span:last");
2.去掉代碼之后,bottonNam 這個(gè)參數(shù)是空的。而且update函數(shù)都不存在了,怎么調(diào)用?

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

清水3201892 提問(wèn)者

非常感謝!
2016-08-20 回復(fù) 有任何疑惑可以回復(fù)我~

感覺(jué)$("button:first").trigger('click','last'); 里面的last對(duì)應(yīng)的是? $("button:first").click(function(event,bottonName) 里面function的bottonName,不知道我說(shuō)的對(duì)不對(duì)

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

trigger是觸發(fā)被選中元素指定的事件類(lèi)型

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

看看一個(gè)trigger方法的定義

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

舉報(bào)

0/150
提交
取消

2個(gè)疑問(wèn)??

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

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

幫助反饋 APP下載

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

公眾號(hào)

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