2012-11-13 128 views
1

下面是我用於我的jquery插件的CSS。在Jquery工具提示插件中插入一條新線

CSS

<style type="text/css"> 
    body, div { font-family: arial, sans-serif;} 
    body { margin: 0; padding: 0; } 
    h3 { 
     font-size: 110%; 
     font-weight: normal; 
     margin: .2em 0 .5em 0; 
    } 
    #tooltip { 
     position: absolute; 
     z-index: 3000; 
     border: 1px solid #111; 
     padding: 5px; 
    } 
    #tooltip h3, #tooltip div { margin: 0; } 
</style> 

腳本

<script type="text/javascript"> 
    $(function() { 
     $('.studentclass').tooltip({ showURL: false, positionLeft: true, html:true}); 
     $("#block").click($.tooltip.block); 
    }); 
</script> 

HTML

<label id="lblstudentname" 
    runat="server" 
    title="Name of the student in the class " 
    class="studentclass"> 
     STUDENT 
    </label> 

我一直在使用/ BR,/ R/N和緊迫的標題進入,但沒有人似乎工作嘗試。有人可以幫幫我嗎 。

+1

**您正在使用哪個** jQuery工具提示插件? –

+0

可能將我們與[jsfiddle](http://jsfiddle.net/)聯繫起來? – Srinivas

+0

錯過了添加我的問題。這裏是jquery插件的鏈接http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/ – Janet

回答

1

That plug-in允許工具提示中的HTML。換行符的HTML是<br>

1

你可以使用jquery tipsy,它支持<br />

或者,如果你仍然想使用jQuery的提示,你可以做到這樣 - Multiple HTML lines with jquery tooltip plugin這是一個重複的問題/回答類似於你想要什麼,如果你想完全HTML支持。

jquery tooltip應該也支持<br />