强制JQuery对话标题到多行 [英] Force JQuery Dialog Title to Multiple Lines

查看:117
本文介绍了强制JQuery对话标题到多行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何强制jQuery对话框的标题总是两行?

How can I force a jQuery Dialog's Title to always be two lines?

请参阅: http://jsfiddle.net/ VKcJ7 / 24 /

我知道对话框标题包含在一个span中,所以我不知道这是否可能。我希望SOME ITEM部分始终在第一行,Remaining qty ...部分始终在第二行。

I know the dialog title is contained in a span, so I'm not sure if this is possible. I want the 'SOME ITEM' portion to always be on the first line, and the 'Remaining qty...' portion to always be on the second line.

JS:

$(document).ready(function () {
    $('#dialog').dialog({
        autoOpen: false,
        modal: true,
        title: 'SOME ITEM \n Remaining Qty (Cts.): 0'
        //adding the newline character \n is ignored...
    });
});

CSS:

.ui-dialog .ui-dialog-title {
    white-space:normal;
}


推荐答案

的问题(感谢@jazZRo):
在jQuery UI中的对话框标题中使用HTML 1.10
来扩展窗口小部件。

I ended up using the answer of this question (thanks @jazZRo): Using HTML in a Dialog's title in jQuery UI 1.10 to extend the widget.

然后我将标题设置如下:(工作示例: http://jsfiddle.net/VKcJ7/30/

I then set my title as follows: (Working example: http://jsfiddle.net/VKcJ7/30/)

JS:

$(document).ready(function () {
$('#dialog').dialog({
    autoOpen: false,
    modal: true,
    title: 'SOME ITEM <br> Remaining Qty (Cts.): 0'
    //adding the newline character \n is ignored...
});

});

这篇关于强制JQuery对话标题到多行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆