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

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

關(guān)閉時獲取Bootstrap的模態(tài)初始數(shù)據(jù)-*

關(guān)閉時獲取Bootstrap的模態(tài)初始數(shù)據(jù)-*

慕哥6287543 2021-04-02 13:15:14
當表示自舉模式中,可以使用代碼如很容易地檢索相關(guān)聯(lián)的數(shù)據(jù)$('#myModal').on('show.bs.modal', function (e) {   var id = $(e.relatedTarget).data('id');    alert(id);}關(guān)閉引導(dǎo)程序模式時是否可能相同?特別是當被特定按鈕(即確認按鈕,而不是兩個取消按鈕)關(guān)閉時?在relatedTarget似乎沒有提供任何button的模式里面,也不在Shidden.bs.modal事件。在下面的操場data-id屬性值中,當modal以類似方式data-id顯示模式主體時,單擊“是”時,應(yīng)在刪除按鈕下方顯示刪除值:$(document).ready(function () {  $('#deleteModal').on('show.bs.modal', function (e) {      $('#testOutput,#testOutput2').text('');       var id = $(e.relatedTarget).data('id');     $('#deleteId').text(id || 'id retrieval failed');  });    $('#deleteModal').on('hidden.bs.modal', function (e) {      var id = $(e.relatedTarget).data('id'); //does not work      $('#testOutput2').text(id || '"hidden.bs.modal" id retrieval failed');  });      $('#confirmDeleteBtn').click(function (e) {    var id = $(e.relatedTarget).data('id');  //does not work    //var id = $(this).closest('.modal').data('id'); //doesnt work neither    $('#testOutput').text(id || '"btn.close .modal" id retrieval failed');  });});<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous"><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script><script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script><div class="col offset-3">  <div class="d-flex">    <button class="mt-4 btn btn-primary" data-toggle="modal" data-target="#deleteModal" data-id="42">delete record 1</button>    <button class="mt-4 btn btn-primary" data-toggle="modal" data-target="#deleteModal" data-id="123">delete record 2</button>  </div>  <h5 class="mt-4 text-danger" id="testOutput"></h5>  <h5 class="text-danger" id="testOutput2"></h5></div>請注意id,打開的button時間不是恒定的,即有許多deletebutton可以打開單個對話框。
查看完整描述

2 回答

  • 2 回答
  • 0 關(guān)注
  • 119 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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