隐藏Jquery模态窗口中的关闭按钮

时间:2021-07-25 11:49:53

隐藏Jquery模态窗口中的关闭按钮Attached the code that I am using for Pop Up Modal window which generates two close buttons

附上我用于Pop Up Modal窗口的代码,它生成两个关闭按钮

I am trying to hide the Close button generated from iFrame.

我试图隐藏从iFrame生成的关闭按钮。

   jQuery(document.body).append('<div id="dialogDivWindow"></div>');

   jQuery("#dialogDivWindow").html('<iframe id="dialogFrameWindow" width="900" 

   height="500" marginWidth="0" marginHeight="0" frameBorder="0" close="no" 

   src="about:blank" />');

   jQuery("#dialogDivWindow").dialog({      
    height: 'auto',
    width: 950,
    modal: true,
    resizable: false,
    draggable: false,
    autoOpen: false,
    buttons:[
             {
                 text: "Close",
                 icons: { primary: "ui-icon-closethick" },
                 id: "closebtn",
                 click: function() { 
                     var $this = jQuery(this); 
                     $this.dialog("close"); 

                 }
             }
         ],
    open: function() {
                jQuery(this).closest(".ui-dialog").find(
                ".ui-dialog-titlebar-close").removeClass(
                "ui-dialog-titlebar-close").html(
                "<span class='fa fa-times fa-lg'></span>");

         }
  });
  jQuery("#dialogFrameWindow").attr("src", url);
  jQuery("#dialogDivWindow").dialog("open");

This Modal Pop Up generates two Close Buttons.

此模态弹出窗口生成两个关闭按钮。

How can I avoid the close button which generates from iFrame.

如何避免从iFrame生成的关闭按钮。

In Picture I would like to hide the first 'Close' button.

在图片中我想隐藏第一个“关闭”按钮。

anything can be done using Jquery

任何事情都可以使用Jquery完成

2 个解决方案

#1


2  

Remove close='no' within iframe tag.. should work

删除iframe标签中的close ='no'应该有效

#2


0  

Edit the portion. Might help u. add this => type:iframe, showCloseButton:false

编辑部分。可能会帮助你。 add this => type:iframe,showCloseButton:false

if not works. also try showCloseButton:hide instead of showCloseButton:false

如果不起作用。也尝试showCloseButton:hide而不是showCloseButton:false

 jQuery("#dialogDivWindow").dialog({      
    height: 'auto',
    width: 950,
    modal: true,
    resizable: false,
    draggable: false,
    autoOpen: false,
    type   : iframe,
    showCloseButton:false
    buttons:[
             {
                 text: "Close",
                 icons: { primary: "ui-icon-closethick" },
                 id: "closebtn",
                 click: function() { 
                     var $this = jQuery(this); 
                     $this.dialog("close"); 

                 }
             }
         ],
    open: function() {
                jQuery(this).closest(".ui-dialog").find(
                ".ui-dialog-titlebar-close").removeClass(
                "ui-dialog-titlebar-close").html(
                "<span class='fa fa-times fa-lg'></span>");

         }
  });

#1


2  

Remove close='no' within iframe tag.. should work

删除iframe标签中的close ='no'应该有效

#2


0  

Edit the portion. Might help u. add this => type:iframe, showCloseButton:false

编辑部分。可能会帮助你。 add this => type:iframe,showCloseButton:false

if not works. also try showCloseButton:hide instead of showCloseButton:false

如果不起作用。也尝试showCloseButton:hide而不是showCloseButton:false

 jQuery("#dialogDivWindow").dialog({      
    height: 'auto',
    width: 950,
    modal: true,
    resizable: false,
    draggable: false,
    autoOpen: false,
    type   : iframe,
    showCloseButton:false
    buttons:[
             {
                 text: "Close",
                 icons: { primary: "ui-icon-closethick" },
                 id: "closebtn",
                 click: function() { 
                     var $this = jQuery(this); 
                     $this.dialog("close"); 

                 }
             }
         ],
    open: function() {
                jQuery(this).closest(".ui-dialog").find(
                ".ui-dialog-titlebar-close").removeClass(
                "ui-dialog-titlebar-close").html(
                "<span class='fa fa-times fa-lg'></span>");

         }
  });