2017-02-23 78 views
0

我需要大写的工具提示,比如“Mr Raj Patel”。我使用的是工具提示的标题,但是它存在于我保存在数据库中。需要大写的工具提示但是出现问题

HTML代码:

<td class='td_3'><div class='oneline' style='width:"100px !important;text-transform: capitalize;' title='" + item.ClassTeacher + "'> item.ClassTeacher.ToLower() </div></td> 

item.ClassTeacher取价值就像我上面显示“拉杰·帕特尔先生”,但在工具提示它没有自带的利用。

刀具前端的

也给出了屏幕截图

Toot-tip image谢谢。

回答

1

CSS text-transform: capitalize;不会影响title属性(见Can CSS uppercase the text shown for the title atribute

解决方案使用Javascript由Alex建议:

var elem = document.getElementById('divId'); 
elem.title = elem.title.toUpperCase(); 

或captilize item.ClassTeacher在Controller中使用C#o r剃刀查看:

string capitalized = Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(item.ClassTeacher); 
+0

谢谢..其作品... @Georg Patscheider – Herry