Needs review
Project:
YoxView
Version:
7.x-2.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
28 Apr 2011 at 10:57 UTC
Updated:
13 Aug 2013 at 15:44 UTC
YoxView is easy to use and works fine with several browsers, however using IE9 the images are displayed with the wrong height. (500px x 300px)
I placed the following code inside a page:
<head>
<script type="text/javascript" src="/sites/all/modules/yoxview/yoxview/yoxview-init.js"></script>
</head>
<div class="yoxview">
<a href="/sites/default/images/image_1.png">
<img style="margin:15px;" src="/sites/default/images/image_1png" alt="1" title="Image_1" width="100" height=194" /></a>
<a href="/sites/default/images/image_2.png">
<img style="margin:15px;"src="/sites/default/images/image_2.png" alt="2" title="Image_2" width="100" height=194" /></a>
</div>
Is there a workaround?
Comments
Comment #1
kioko commentedI've noticed the same problem on IE9. I wish there was a solution to this as I would really like to use yoxview for my pictures.
Comment #2
cisana commentedI've tried other image gallery alternatives but at the end I finished using HTML-iframe in a basic-page (DP7).
It works for me, then I only need to show 5 images. It's similar to the iPhone App Store.
If anybody is interested I would post my solution.
Comment #3
cisana commentedComment #4
SeanKendle commented(YoxView 2.21):
I have reproduced this problem (unfortunately in a production environment, and my client found it... O_o), and have figured out how to fix it (not just work around it like above with iframes):
The problem exists in
function loadAndDisplayMedia(media)(lines 2107 & 2108):It appears they put these two lines in the code to prevent rendering issues in older versions of Chrome, and it supposedly wouldn't affect IE (<8) because it didn't support the "opacity" property. Well, apparently IE 9+ now supports this property. What happens is, it sets the src of the
mediavariable to "", which then later causes an error to bubble up. When that happens it then calls (line 2153):As you can see, it sets the outer image holding Div to 500x300 pixels, giving you a squashed and ugly image in the viewer!
I commented out the lines, and it started working in IE, but then was broken in Chrome. The initial image load worked in Chrome, but exiting out of the slideshow, and then clicking on an image in the gallery would leave it tiny and spinning its wheels...
To fix this problem change line 2107 to:
if (window.chrome)Tested in IE 10.0.9200.16635, Firefox 22.0 & 23.0, and Chrome 28.0.1500.95 m
Comment #4.0
SeanKendle commentedAdded specific height and width the image is being set to.