简体   繁体   English

工具提示显示内容

[英]Tooltip display content

Tooltip display content how to show as below format 工具提示显示内容如何以以下格式显示

Please help me 请帮我

"Dynamic_value" values are coming from function in variable and i want to display as below format “ Dynamic_value”值来自函数中的变量,我想以以下格式显示

Selection Parameters 选择参数

Selection Date - Dynamic_value 选择日期-动态值

Unit Value- Dynamic_value 单位价值-动态价值

list - Dynamic_value 列表-动态值

below is example of code 下面是代码示例

 <label id="lblName" for="txtName" title="Full Name">Name</label> <input id="txtName" type="text" title="Your full name as it appears in paasport" /> <meta charset="utf-8"> <title>tooltip demo</title> <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css"> <script src="//code.jquery.com/jquery-1.12.4.js"></script> <script src="//code.jquery.com/ui/1.12.1/jquery-ui.js"></script> <script type="text/javascript"> $(document).ready(function() { $('#txtName').tooltip({ content: toolTipFunction }); function toolTipFunction() { var texdisp = 'Selection Date - Dynamic_value; Unit Value- Dynamic_value; list - Dynamic_value'; return texdisp } }); </script> 

If I am understanding the question correctly, you're just struggling to include line breaks where you want them. 如果我正确地理解了这个问题,那么您只是想在所需的位置插入换行符。 This can be done simply by including <br /> elements in the texdisp string. 只需在texdisp字符串中包含<br />元素即可完成此操作。

 <label id="lblName" for="txtName" title="Full Name">Name</label> <input id="txtName" type="text" title="Your full name as it appears in paasport" /> <meta charset="utf-8"> <title>tooltip demo</title> <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css"> <script src="//code.jquery.com/jquery-1.12.4.js"></script> <script src="//code.jquery.com/ui/1.12.1/jquery-ui.js"></script> <script type="text/javascript"> $(document).ready(function() { $('#txtName').tooltip({ content: toolTipFunction }); function toolTipFunction() { var texdisp = 'Selection Date - Dynamic_value;<br /><br /> Unit Value- Dynamic_value;<br /><br /> list - Dynamic_value'; return texdisp } }); </script> 

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

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