Fix it so that pins show up on IE.

In pinry.js, reference is made to image.width and image.height
properties, neither of which exist. They are used to compute the
target height of the image, by computing the aspect ratio
image.width/image.height. Unfortunately, undefined/undefined yields
NaN, and so we end up writing "height='NaN'" into the HTML.

It looks like webkit (at least chrome) ignores it when the height
attribute on an <img /> element is set to NaN, but Internet Explorer
treats it as zero. That's why it didn't look broken on other browsers.
This commit is contained in:
John Doty
2012-05-10 21:34:03 -07:00
parent 10ffd90760
commit ea7ce9a507

View File

@@ -61,7 +61,7 @@ $(window).ready(function () {
image = data[i];
html += '<div class="pin">';
html += '<a class="fancybox" rel="pins" href="'+image.image+'">';
html += '<img src="'+image.thumbnail+'" width="200" height="'+Math.round(image.height/image.width*200)+'">';
html += '<img src="'+image.thumbnail+'" width="200" >';
html += '</a>';
html += '<p>'+image.description+'</p>';
html += '</div>';