Reputation: 23
I'm trying to load an image using FancyBox and once the image is loaded it should display a magnifying glass when hovering over the image.
I'm using the following javascript file to display the magnifying glass: http://www.dailycoding.com/Uploads/2011/03/imageLens/demo.html
My code is as follows:
<script type="text/javascript">
$(document).ready(function() {
/* This is basic - uses default settings */
$("a#single_image").fancybox({
'titlePosition' : 'inside',
onComplete: function(){
alert("test");
$("#fancybox-img").imageLens();
}
});
I'm trying to load the imageLens using the "onComplete" method but nothing happens... does anyone know whats wrong with my code?
Thanks
Upvotes: 0
Views: 707
Reputation: 11
You have to use Colorbox plugin (it's similar to fancybox):
$(".callbacks").colorbox({
onComplete:function(){$('.cboxPhoto').imageLens( {lensSize: 200 }); }
});
Upvotes: 1