简体   繁体   English

在对话框的标题栏中添加图像

[英]Add an image in title bar in a dialog box

In this example, how can i add a small image side by side with the title? 在此示例中,如何与标题并排添加小图像?

http://jsfiddle.net/F9uR3/ http://jsfiddle.net/F9uR3/

anyone? 任何人? thanks. 谢谢。

<span class="dialog">English</span>

<div id="dialog" class="dialogBox" title="LessonSelected">
<img src="https://www.google.com/logos/2014/worldcup14/opening/cta.png" />

.ui-dialog-content div { background: url(https://www.google.com/logos/2014/worldcup14/opening/cta.png) no-repeat !important; }

$(function() {
    $('#dialog').dialog({
        resizable:false,
        autoOpen: false,
        buttons: {
            "Enrol": function()
            {
                $(this).dialog('close');
                choice(true);
            },
            "Cancel Enrol": function()
            {
                $(this).dialog('close');
                choice(false);
            }
        }
    });

$( ".dialog" ).click(function(){        
    $('#dialog').dialog("open");
});

}); });

try like this one 像这样尝试

$(function () {

$('#dialog').dialog({
    title: $('<img src="http://blog.laptopmag.com/wpress/wp-content/uploads/2012/02/Google-logo-small.jpg" />'),
    resizable: false,
    autoOpen: false,
    buttons: {
        "Enrol": function () {
            $(this).dialog('close');
            choice(true);
        },
            "Cancel Enrol": function () {
            $(this).dialog('close');
            choice(false);
        }
    }
});

$(".dialog").click(function () {
    $('#dialog').dialog("open");
  });
});

try to scale the image first at size 尝试先按尺寸缩放图像

Here is the fiddle with your example 这是你的例子的小提琴

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM