qTip2(工具提示)换行符不起作用 [英] qTip2 (tooltip) line break not working
本文介绍了qTip2(工具提示)换行符不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图在插件qTip2的文本中添加一些换行符,但没有成功.
I'm trying to add some line break to the text of the plugin qTip2 without any success.
到目前为止,我已经尝试了<br/>
,<p>
和white-space: pre-line
,但均未成功.
So far I've tried <br/>
, <p>
and also white-space: pre-line
without any success.
您可以查看完整的示例 http://jsfiddle.net/6asMt/1/
You can view a full example http://jsfiddle.net/6asMt/1/
我一直在Google周围搜索,但找不到任何有效的方法. 我希望我的最终结果是:
I've been searching around the google but can't find anything that works. I would like my final result to be:
Date Start: 2014-04-08 10:00:00
Date End: 2014-04-10-10-00-00
不是
Date Start: 2014-04-08 10:00:00 Date End:
2014-04-10-10-00-00
推荐答案
请检查此 JS小提琴代码
JS代码:
JS Code:
$('a').each(function () {
if ($(this).hasClass('qTip')) {
var value = $(this).next('div:hidden').text();
var title = $(this).attr('title');
$('.qTip').qtip({
style: {
classes: 'qtip-bootstrap'
},
content: {
title: title,
//text: value // The problem is here (on the `text` option)
text: $(this).next('div')[0].innerHTML
}
});
}
});
如果还有其他问题,请在下面添加评论.
If you have any other issue, then please add a comment below.
关于D.
这篇关于qTip2(工具提示)换行符不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文