简体   繁体   English

Twitter Bootstrap Popover不工作?

[英]Twitter Bootstrap Popover not working?

I have the tooltip for bootstrap working, but anytime I try and initiate the popover instead I get the error Uncaught TypeError: Cannot read property 'prototype' of undefined or Uncaught TypeError: Cannot read property 'Constructor' of undefined with the following code 我有工具提示工作提示工作,但任何时候我尝试启动popover而不是我得到错误Uncaught TypeError:无法读取未定义或未捕获的TypeError 属性'原型' :无法使用以下代码读取属性'构造函数'未定义

 Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, {

    constructor: Popover

  , setContent: function () {
      var $tip = this.tip()
        , title = this.getTitle()
        , content = this.getContent()

      $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
      $tip.find('.popover-content')[this.options.html ? 'html' : 'text'](content)

      $tip.removeClass('fade top bottom left right in')
    }

I am unclear of the hiccup, because I did see it working previously. 我不清楚打嗝,因为我确实看到它以前有效。 Any ideas? 有任何想法吗? Thanks in advance. 提前致谢。

I had this same issue and was able to fix it with the help of Paul Watson's comment 我有同样的问题,并且能够在Paul Watson的评论的帮助下修复它

Make sure bootstrap-tooltip.js is included before bootstrap-popover.js 确保 bootstrap-popover.js 之前包含bootstrap-tooltip.js

Try wrapping your call in a $(document).ready() block 尝试将您的调用包装在$(document).ready()块中

ie: 即:

$(document).ready(function() {
    $('.tipsPop').tooltip();
});

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

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