摘要:[jQuery UI]jQuery Tooltip 資訊內容換行方法
content: function() {
return $(this).attr('title');
}
<!--jQuery-->
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<script>
$(function() {
$( document ).tooltip(
{
content: function() {
return $(this).attr('title');
}
});
});
</script>
<h1>jQuery Tooltip</h1>
Example : <input type="text" title="Hello Everybody<br />Test(br)!">
執行畫面如圖:
參考資料:http://stackoverflow.com/questions/13066909/how-to-break-line-in-jqueryui-tooltip