Based on the information you have provided, this code should do the trick :
<script type='text/javascript'>
jQuery.noConflict();
jQuery(document).ready(function ($) {
jQuery('a.myfancybox').fancybox({
'zoomSpeedIn': 500,
'zoomSpeedOut': 500,
'overlayShow': true,
'overlayOpacity': 0.3,
'onComplete': function () {
$("#fancybox-img").wrap("<a class='myZoom' href='http://www.mcemcourses.org/wp-content/uploads/9-Orbital-floor-.jpg' />");
$("a.myZoom").swinxyzoom({
mode: 'lens' // or your preferred mode
});
}
});
});
</script>
Notice that you will need 3 images :
- Your thumbnail, the one you click to open fancybox.
- A middle size image, the one you target in the
href
of the link that opens fancybox, and actually, the image opened in fancybox.
- A big size image, the one you set in the
href
of the wrapping anchor inside the onComplete
callback.
Also notice that the selector #fancybox-img
refers to the opened image in fancybox for v1.3.x only.
NOTE : Most popular fancybox WordPress plugins use v1.3.4.
See JSFIDDLE