can3p/iviewer — Issue #17: iviewer with lightbox using method center
Author: Elodie1
Created: 2012-02-09 13:14:12+00:00
State: open

Hello,

I'm using iviewer with the lightbox demo, it's working great execpt that I can't seems to be able to use any method or option.
I want to load the image with a zoom of 50% instead of fit, it's all fine just I can't understand how to call the center() function. Because my image being smaller than the container I want is center by default.
I'm sure it's very easy but I try everything and it never work.

I also try to set a max zoom and min zoom but it doesn't work.

I use the example for lightbox and almost didn't change anything.

var viewer = $("#iviewer .viewer").
width(920).
height(560).
iviewer({
src : src,
ui_disabled : true,
zoom : '50%',
zoom_min: '50%',
zoom_max: '300%',
initCallback : function() {
var self = this;

},
onZoom : function() {
if (!firstZoom) return;

$("#iviewer .loader").fadeOut();
$("#iviewer .viewer").fadeIn();
firstZoom = true;
}
}
);

Thanks for the help.