if (readmode) {
w = Math.max(w * 0.5, nw);
forceHeight = false;
+
if (w > ww * 0.9) {
fullscreen = true;
w = ww;
h = hh;
+ s = ww / nw;
+
+ } else {
+ s = w / nw;
+
}
+ x = 0;
+ y = 0;
} else {
forceHeight = true;
s = Math.min(w / nw, h / nh);
- if (iframe.is('img')) {
+ if (iframe.is('img') || fullscreen) {
s = Math.min(1, s);
}
if (!fullscreen) {
w = nw * s;
h = nh * s;
}
- x = ( w - (nw * s) ) / 2;
- y = (h - (nh * s)) / 2;
- if (s < 1) {
- var css = {overflow: 'hidden', width: nw * s, height: nh * s};
- m.find('.multimediaHolder').css(css);
- } else {
- m.find('.multimediaHolder').css({width: '', height: ''});
- }
+ x = (w - (nw * s) ) / 2;
+ y = (h - (nh * s)) / 2;
}
- m.find('.multimediaScale').css({width: nw, height: nh, overflow: 'hidden'}).transform({translateX: x + 'px', translateY: y + 'px', scale: [s, s], origin: [0, 0]}).css('text-align', 'left');
+ if (s < 1) {
+ var css = {overflow: 'hidden', width: nw * s, height: nh * s, top: y, left: x, position: 'absolute'};
+ m.find('.multimediaHolder').css(css);
+ } else {
+ m.find('.multimediaHolder').css({position: "", overflow: '', width: '', height: '', top: '', left: ''});
+ }
+
+ m.find('.multimediaScale').css({width: nw, height: nh, overflow: 'hidden'}).transform({scale: [s, s], origin: [0, 0]}).css('text-align', 'left');
break;
default:
break;