Search code examples
jquerypluginszoomingcolorbox

jQuery Zoom inside a colorbox


Is it possible to use the jQuery Zoom plugin from Jack Moore inside a colorbox?

$(document).ready(function(){
  $('a.photo').zoom({url: 'photo-big.jpg'});
});

Solution

  • I'm pretty sure you can do this this way :

    $('a.colorbox').colorbox({
        'onComplete': function(){ 
            $('#cboxLoadedContent img').wrap('<span style="display:inline-block"></span>')
                .css('display', 'block')
                .parent()
                .zoom();
        }
    });
    

    From : http://www.jacklmoore.com/zoom/

    EDIT : It seems to works without the extra wrap

    From : @Peter

    $('a.colorbox').colorbox({
        'onComplete': function(){ 
            $('#cboxLoadedContent').zoom();
        }
    });