Mercurial > public > sg101
comparison forums/static/js/forums.js @ 643:081a88b3bfc8
Improve forum images resize script. Issue #32.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sun, 10 Mar 2013 12:47:21 -0500 |
parents | ee87ea74d46b |
children | 99f7917702ca |
comparison
equal
deleted
inserted
replaced
642:cb61b53472d2 | 643:081a88b3bfc8 |
---|---|
286 ++vid; | 286 ++vid; |
287 } | 287 } |
288 | 288 |
289 initAttachments(); | 289 initAttachments(); |
290 | 290 |
291 $('div.forum-post-body img').fadeIn('fast', function() { | 291 $('div.forum-post-body img').imagesLoaded(function($images, $proper, $broken) { |
292 var pic = $(this); | 292 $proper.each(function(index) { |
293 if (pic.width() > 720) { | 293 var $pic = $(this); |
294 pic.css('width', '720px'); | 294 if ($pic.width() > 660) { |
295 } | 295 $pic.css('width', '660px'); |
296 $pic.wrap($('<a/>').attr('href', $pic.attr('src')).attr('title', 'Click to view full size')); | |
297 } | |
298 }); | |
296 }); | 299 }); |
297 }); | 300 }); |