fancybox open/close image view on mouse hover
I'm trying to open and close an image when hovering with fancybox.
The open part I've solved, what about close on mouseout? Or is there another plugin 开发者_开发技巧with this default functionality?
http://www.eyerideonline.com/ - the center image - how eyeride works?
To achieve the mouseout
function simply add another function within hover
. Though I searched through the Fancybox plug-in and couldn't find an element to target for the mouseout function. So you may have to add an extra element that is wrapped around the image to target for mouseout
.
jQuery(document).ready(function($) {
$("a").fancybox().hover(function() {
$(this).click();
}, function() {
$(*replace with element*).click();
});
});
Maybe this could help:
$("#fancybox-outer").fancybox().mouseleave( function() {
$("#fancybox-overlay").click();
});
精彩评论