// When mouse enters the image
// Use $ instead of jQuery if you prefer
jQuery(#your_image_ID).mouseenter(function()
{
jQuery(this).fancybox({
'transitionIn' : 'fade',
'transitionOut' : 'fade',
'titlePosition' : 'over'
});
});
<script type="text/javascript">
$(document).ready(function() {
$('.woodImg').mouseenter(function() //<-------- missing ''
{
$(this).fancybox({
'transitionIn' : 'fade',
'transitionOut' : 'fade',
'titlePosition' : 'over'
});
});
});
</script>
What you want to do will not work. You hover the cursor over the
thumbnail, Fancybox opens up and has the focus. Now you cannot move away
from the thumbnail and expect the FancyBox window to close, as the focus
is now in the new FancyBox window and NOT on your thumbnail anymore.
Second problem I see is that what will happen if you flick your mouse
cursor over the thumbnail or series of thumbnails? You will have a
myriad of windows opening. And what will happen if you move from
thumbnail to thumbnail while a FancyBox window is open? Which one to
close now ...?
I would either do this using plain CSS and jQuery or have the user
manually closing the FancyBox window.
I think this is what you want to do:
http://www.sohtanaka.com/web-design/examples/image-zoom/
Tutorial is here -
http://www.sohtanaka.com/web-design/fancy-thumbnail-hover-effect-w-jquery/
Maybe some know of a better way, but the CSS and JQuery method is fast
and clean.