在这个例子中,我如何与标题并排添加一个小图像?
人? 感谢。
<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");
});
});
答案 0 :(得分:0)
试试这个
$(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");
});
});
尝试首先按尺寸缩放图像
以下是您的示例中的fiddle