jquery .fadeto效果在图像之间闪烁(工具提示)

时间:2011-04-12 14:54:58

标签: jquery

我在一堆图像表的顶部使用jquery fadeTo效果来处理一些工具提示。

除了一个细节之外,这是完美的。当我在两个图像(正在触摸)之间拖动鼠标时,从第一个图像工具提示切换到第二个图像时,会出现短暂的“闪烁”。

我想不出办法阻止这种情况发生。在那里?

这是我用于使用qtip的工具提示的javascript。

   $('.tipper').each(function()
   {
      $(this).qtip({
         content: $(this).attr('tooltip'), // Use the tooltip attribute of the element for the content
         position: {target: 'mouse', adjust: {x: 20 }},
         show: { effect: function() { $(this).fadeTo(300, 0.9);}, length:0},
         hide: { effect: 'none', length:0, delay:0 },
         style: { border: { width: 2, radius: 0 , color: '#fff'} ,width: 200,  name: 'light', fontFamily: 'Arial', 'font-size': '12px', 'letter-spacing': 1, lineHeight:1.6, textAlign:'center', textTransform:'uppercase', fontWeight:'bold'},
      });
   });

1 个答案:

答案 0 :(得分:0)

我不是百分百肯定,但也许这会更好:

$('.tipper').qtip({
    content: $(this).attr('tooltip'), 
    // Use the tooltip attribute of the element for the content
    position: {target: 'mouse', adjust: {x: 20 }},
    show: { effect: function() { $(this).fadeTo(300, 0.9);}, length:0},
    hide: { effect: 'none', length:0, delay:0 },
    style: { border: { width: 2, radius: 0 , color: '#fff'} ,
             width: 200,  
             name: 'light', 
             fontFamily: 'Arial', 'font-size': '12px', 'letter-spacing': 1,
             lineHeight:1.6, 
             textAlign:'center', 
             textTransform:'uppercase', 
             fontWeight:'bold' },
});