jQuery甘特图添加qtip作为提示?

时间:2012-06-06 09:08:44

标签: jquery jquery-ui

我正在使用http://mbielanczuk.com/jquery-gantt/插件

是否有人知道如何将鼠标悬停提示更改为qTip2

1 个答案:

答案 0 :(得分:0)

最后我明白了! :)

以下是如何通过q​​tip2更改fn-gantt-hint。打开js文件并搜索;

if (desc)
 {
   bar
...
 }
return bar;

然后删除或只是评论这个;

.mouseover(function(e){
    var hint = $("<div class='fn-gantt-hint' />").html(desc);
    $("body").append(hint);
    hint.css('left', e.pageX);
    hint.css('top', e.pageY);
    hint.show();
  })
  .mouseout(function(){
    $(".fn-gantt-hint").remove();
  })
  .mousemove(function(e){
     $('.fn-gantt-hint').css('left', e.pageX);
     $('.fn-gantt-hint').css('top', e.pageY+15);
 });

有了这个;

bar.qtip({
    content: desc,
    position: {
        my: 'top left',
        target: 'mouse',
        viewport: $(window), // Keep it on-screen at all times if possible
        adjust: {
            x: 10,  y: 10
        }
    },
    hide: {
        fixed: true // Helps to prevent the tooltip from hiding ocassionally when tracking!
    },
    style: 'ui-tooltip-shadow'
});

然后你完成了! :)干杯!带有qtip2的甘特图!通过分享插件和qtip2来归功于mbielanczuk!我爱你们! :))

相关问题