mirror of
https://github.com/pinry/pinry.git
synced 2026-01-17 12:42:10 +01:00
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:
@@ -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>';
|
||||
|
||||
Reference in New Issue
Block a user