jQuery UI Dialog - missing close icon

前端 未结 17 2083
礼貌的吻别
礼貌的吻别 2020-11-28 19:15

I\'m using a custom jQuery 1.10.3 theme. I downloaded every straight from the theme roller and I have intentionally not changed anything.

I created a dialog box and I

相关标签:
17条回答
  • 2020-11-28 19:42

    A wise man once helped me.

    In the folder where jquery-ui.css is located, create a folder named "images" and copy the below files into it:

    ui-icons_444444_256x240.png

    ui-icons_555555_256x240.png

    ui-icons_777620_256x240.png

    ui-icons_777777_256x240.png

    ui-icons_cc0000_256x240.png

    ui-icons_ffffff_256x240.png

    and the close icon appears.

    0 讨论(0)
  • 2020-11-28 19:43

    Even loading bootstrap after jquery-ui, I was able to fix using this:

    .ui-dialog-titlebar-close:after {
       content: 'X' !important;
       position: absolute;
       top: -2px;
       right: 3px;
    }
    
    0 讨论(0)
  • 2020-11-28 19:46

    I am late to this one by a while, but I'm going to blow your mind, ready?

    The reason this is happening, is because you are calling bootstrap in, after you are calling jquery-ui in.

    Literally, swap the two so that instead of:

    <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
    <script src="js/bootstrap.min.js"></script>
    

    it becomes

    <script src="js/bootstrap.min.js"></script>
    <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
    

    :)

    Edit - 26/06/2015 - this keeps attracting interest months later so I thought it was worth an edit. I actually really like the noConflict solution offered in the comment underneath this answer and clarified by user Pretty Cool as a separate answer. As some have reported issues with the bootstrap tooltip when the scripts are swapped. I didn't experience that issue however because I downloaded jquery UI without the tooltip as I didn't need it because bootstrap. So this issue never came up for me.

    Edit - 22/07/2015 - Don't confuse jquery-ui with jquery! While Bootstrap's JavaScript requires jQuery to be loaded before, it doesn't rely on jQuery-UI. So jquery-ui.js can be loaded after bootstrap.min.js, while jquery.js always needs to be loaded before Bootstrap.

    0 讨论(0)
  • 2020-11-28 19:46

    I was facing same issue , In my case JQuery-ui.js version was 1.10.3, After referring jquery-ui-1.12.1.min.js close button started to visible.

    0 讨论(0)
  • 2020-11-28 19:49

    As a reference, this is how I extended the open method as per @john-macintyre's suggestion:

    $.widget( "ui.dialog", $.ui.dialog, {
    	open: function() {
    		$(this.uiDialogTitlebarClose)
    			.html("<span class='ui-button-icon-primary ui-icon ui-icon-closethick'></span><span class='ui-button-text'>close</span>");
    		// Invoke the parent widget's open().
    		return this._super();
    	}
    });

    0 讨论(0)
提交回复
热议问题