2016-09-17 81 views
0

我想添加功能到我的成功按鈕,或一些類似的行動:在我的模式與bootstrap我怎麼能做到這一點?如何將功能添加到我的成功按鈕?

$('#add_item').on('click',function(){ 
    $('#myModal').modal({ 
     backdrop: 'static', 
     keyboard: false, 
    }); 
}); 
+2

你要添加什麼功能? – luissimo

+0

我想添加任何函數,$ .ajax({})或其他 – azdejo

回答

0

一個嘗試這些壞男孩:

$('#add_item').on('click',function(){ 
     $('#myModal').modal({ 
     backdrop: 'static', 
     keyboard: false, 
     $(this).hide();    // add hide function inside of modal 
     $('#add_item').hover(function() { // add hover event handler && function inside of modal 
      $(this).text('new text'); 
     }); 
     }); 
     $('.class').hide();    // add hide function outside of modal 
     $('.class').hover(function(){ // add hover event handler && function outside of modal 
     $('#add_item'). 
     }); 
}); 
相關問題