亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

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

在插件函數中調用 html 數據集

在插件函數中調用 html 數據集

青春有我 2021-08-20 19:02:50
<button class="draw-sector-button" data-sector_no="0">Draw first</button><section id="section-0"></section><button class="draw-sector-button" data-sector_no="1">Draw second</button><section id="section-1"></section>一個 HTML 頁面,有多個部分,每個部分都有按鈕。單擊按鈕觸發插件,然后填充相關的部分標簽。問題是,在插件回調中獲取標簽數據集,但“這個”指標不起作用:$('.draw-sector-button').myDrawPlugin({ // my data table generator    param1 : 'foo',    param2 : 'bar',    onComplete : function(result) {        var i = $(this).data('sector_no'); // (i : undefined)        $('#section-'+i).html(result.data_table);    }});他們說的是相反的:“您可以通過回調中的 this 關鍵字訪問實際的圖像節點?!?在JQuery 學習中心頁面中。所以我很困惑。任何人都可以提供解決方案嗎?
查看完整描述

1 回答

  • 1 回答
  • 0 關注
  • 167 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號