2014-11-05 40 views
0

无法获得jQuery工具提示的预期结果。我希望它显示在我的锚标记的右侧,但没有发生。 经过这Jquery UI tool tipjquery工具提示在div或锚标记的右侧

但仍然没有得到任何的事情。

$(function() { 
$(document).tooltip({ 

position: { 
    my: "center bottom-20", 
    at: "center top", 
    using: function(position, feedback) { 
     $(this).css(position); 
     $("<div>") 
     .addClass("arrow") 
     .addClass(feedback.vertical) 
     .addClass(feedback.horizontal) 
     .appendTo(this); 
    } 
    } 

}); 
}); 

这里是我的小提琴Jquery UI tooltip

其中显示了以上链接的箭头。

+0

改变这一行我:“center bottom-20”,我的:“right-30”,只是让我知道这是否是你需要的东西! – 2014-11-05 11:47:28

+0

@SUDHIR不让它将工具提示移动到锚标记的左侧,箭头仍指向底部。 – Rockstar 2014-11-05 12:04:44

回答

1

替代的解决方案: 您可以使用jQuery的jBox该工具提示为你工作的好。 这里是Link

+0

好主意ñ工作得很好。 ;) – Rockstar 2014-11-07 03:37:19

0

试试这个:

$(function() { 
    $(document).tooltip({ 

    position: { 
     my: "left+40", 
     at: "center right", 
     using: function(position, feedback) { 
      $(this).css(position); 
      $("<div>") 
      .addClass("arrow") 
      .addClass(feedback.vertical) 
      .addClass(feedback.horizontal) 
      .appendTo(this); 
     } 
     } 

    }); 

你得调整箭头 JSFiddle

+0

向右移动,但箭头仍然朝下,因此如何调整指向箭头,即在工具提示的左侧。 – Rockstar 2014-11-05 12:06:43