我正在使用 jquery 的负载通过 ajax 引入缩略图。我希望用户能够将鼠标悬停在裁剪的拇指上,以使用imgPreview 插件查看未裁剪的小版本图像。如果他们点击它,然后在灯箱 ( fancybox )中显示全尺寸图像。
对于灯箱,我有:
$("ul#plant_gallery li a").livequery( function(){
$(this).fancybox ({ 'overlayOpacity': 0.9, 'overlayColor': '#000', });
});
对于工具提示未裁剪的图像悬停,我有:
$('ul#plant_gallery li a').live('mouseover', function()
{
if (!$(this).data('init'))
{
$(this).data('init', true);
$(this).imgPreview({imgCSS: { width: 200 }, srcAttr: 'rel'})
(
function()
{
},
function()
{
}
);
$(this).trigger('mouseover');
}
});
我怎样才能将这两者合二为一?我应该使用 jquery 的 live 还是 livequery?谢谢你的帮助!