player/js/player.js
changeset 20 8c14a340a221
parent 19 a07c2128b7c1
child 21 f5296d2dac57
--- a/player/js/player.js	Mon Jun 10 18:36:46 2013 +0200
+++ b/player/js/player.js	Mon Jun 10 18:56:54 2013 +0200
@@ -303,12 +303,14 @@
                         srcimg = slide.image,
                         imgel = $("<img>");
                     imgel.addClass("slideshow-image");
+                    var wcont = 650, hcont = 452, wsrc = srcimg.width, hsrc = srcimg.height, scale = Math.min(1, Math.min(wcont/wsrc, hcont/hsrc)), h = hsrc * scale;
                     imgel.attr({
                         src: srcimg.src,
                         title: slide.title,
-                        alt: slide.title
+                        alt: slide.title,
+                        width: wsrc * scale,
+                        height: h
                     });
-                    var wcont = 650, hcont = 452, wsrc = srcimg.width, hsrc = srcimg.height, scale = Math.min(1, Math.min(wcont/wsrc, hcont/hsrc)), h = hsrc * scale;
                     imgel.css({
                         opacity: 0,
                         "margin-top": (h < hcont ? Math.floor((hcont-h)/2)+"px": 0)