javascript – 如何隐藏Jquery UI对话框上的按钮

前端之家收集整理的这篇文章主要介绍了javascript – 如何隐藏Jquery UI对话框上的按钮前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
参见英文答案 > How can I disable a button on a jQuery UI dialog?14个
我一直在使用JQuery UI对话框.我正在使用以下代码.任何人都可以让我知道如何在点击后隐藏导出按钮
  1. $( "#dialog-confirm1" ).dialog({
  2. resizable: false,height:350,width:650,modal: false,autoOpen:false,buttons: {
  3. "Export": function() {
  4. exportCSV(2);
  5.  
  6.  
  7. },Cancel: function() {
  8. $( this ).dialog( "close" );
  9. }
  10. }
  11. });

解决方法

您可以使用$(‘.ui-button:contains(Export)’).hide():(以下代码在您单击时隐藏导出按钮)
  1. $( "#dialog-confirm1" ).dialog({
  2. resizable: false,buttons: {
  3. "Export": function() {
  4. exportCSV(2);
  5. $(event.target).hide();
  6.  
  7.  
  8. },Cancel: function() {
  9. $( this ).dialog( "close" );
  10. }
  11. }
  12. });

猜你在找的jQuery相关文章