2013-01-06 30 views
0

第一篇文章,所以提前道歉。Fancybox 2标题悬停在画廊更改

我使用这个 How to display fancybox title only on image hover 和它的作品一种享受,当您单击上一页/下一页,除了与光标已经徘徊,标题不会出现 - 你必须悬停并回。

任何想法如何让标题出现,如果你已经悬停当图像加载?

例这里 http://www.richardbarry.co.uk/fancyhover.php

它的工作的fancybox 1,像这个 - http://www.richardbarry.co.uk/gallery.php

任何帮助非常赞赏

+0

这取决于浏览器,Chrome浏览器它的工作原理像您期望的但不是FF – JFK

回答

0

作为一种变通方法,您可以尝试增加一个功能,如果鼠标检测已经徘徊在this post的fancybox内容....然后显示fancybox标题,如果是这样。

$(".fancybox").fancybox({ 
    helpers: { 
    title: { 
     type: 'over' 
    } 
    }, 
    afterShow: function() { 
    $(".fancybox-title").hide(); 
    // shows/hides title on hover 
    $(".fancybox-wrap").hover(function() { 
     $(".fancybox-title").stop(true, true).slideDown(200); 
    }, function() { 
     $(".fancybox-title").stop(true, true).slideUp(200); 
    }); 
    // detects if mouse is already hovering 
    $(".fancybox-outer a, .fancybox-outer img").hover(function() { 
     $(this).data('timeout', setTimeout(function() { 
     $(".fancybox-title").stop(true, true).slideDown(200); 
     }, 100)); 
    }, function() { 
     clearTimeout($(this).data('timeout')); 
    }); 
    } 
}); 

JSFIDDLE ...这似乎在IE7 +做工精细和FF

+0

最好的,谢谢! – ernieball42