小编MD.*_*lim的帖子

在初始化之前无法在工具提示上调用方法

我正在使用jQuery工具提示动态创建行(可以是10行/更多行)

工具提示正在正确显示但关闭不正确.

错误如下,

Error: cannot call methods on tooltip prior to initialization; attempted to call method 'close'

throw new Error( msg );

while(m < 10){

  .......................................
  .......................................

  if(data =="EXIST")
  {
    display_tp_tooltip(m);
    $("#tp_no"+m).val("");
  }
  else
  {
    display_tp_tooltip_close(m);
  }
}

function display_tp_tooltip(m)
{
   $("#tp_no"+m).tooltip();
   $("#tp_no"+m).tooltip({
        open: function (e, o) {
        o.tooltip.animate({ top: o.tooltip.position().top + 10 }, "fast" );
        $(o.tooltip).mouseover(function (e) {
            $("#tp_no"+m).tooltip('close');
        });
        $(o.tooltip).mouseout(function (e) {});
        },

        position: {
        my: "center bottom-20",
        at: "center top",
        using: function( position, feedback ) {
            $( …
Run Code Online (Sandbox Code Playgroud)

jquery compiler-errors jquery-ui dynamic-data twitter-bootstrap

11
推荐指数
3
解决办法
2万
查看次数