2016-01-13 102 views
0

我使用下面的代碼也找到代碼here。請你幫忙。無法顯示懸停在懸停td元素的表

<table> 
    <tbody> 
    <tr class="myrow1">       
    <td class="cpCode"> 
    <span rel="replace">Need PopOver</span> 
    </td> 
    </tr> 

jQuery(function($) { 
     $('[rel=replace]').popover({trigger: 'hover', 
       placement : 'top', 
       html: 'true',        
       content :'Hello'        
        });      
}); 
+0

能否請您解釋一下吧更多? – Codeone

+0

我認爲你提供了錯誤的小提琴 – Siddharth

+1

你好Siddharth,請檢查現在更新小提琴 – Adi

回答

0

我看到了你的小提琴,你錯過了引導/ jQuery的文件,這裏是相同fiddle,它是工作的罰款

$(document).ready(function(){ 
    $('[rel="replace"]').popover({ 
      trigger: 'hover', 
      placement : 'bottom', 
      html: 'true',        
      content :'Hello' 
    }); 
}); 
+0

你好Siddharth,我能搞到小提琴這是我的小提琴[鏈接](https://jsfiddle.net/atotadhm/bvb3L851/) 它工作正常在提琴但不在代碼中。我在其他頁面使用popover,它工作的很好。下面是我如何創建td。 $(this).append(''+ key +''); td及其文本顯示fine.but不彈出 – Adi

+2

檢查此鏈接爲動態元素添加彈出窗口http://stackoverflow.com/questions/16990573/how-to-bind-bootstrap-popover-on-dynamic-elements –

+1

我爲此做了一個[fiddle](https://jsfiddle.net/tr02bL5c/),你需要使用'popover'的'selector'選項作爲@NarendraCM提到的 – Siddharth