Advertisement
Adam_Wadsworth

Montage

Nov 18th, 2011
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1.  
  2.  
  3. $(window).load(function() {
  4. var $container = $('.am-container'),
  5. $imgs = $container.find('img').hide(),
  6. totalImgs = $imgs.length,
  7. cnt = 0;
  8.  
  9. $imgs.each(function(i) {
  10. var $img = $(this);
  11. $('<img/>').load(function() {
  12. ++cnt;
  13. if( cnt === totalImgs ) {
  14. $imgs.show();
  15. $container.montage({
  16. fillLastRow : true,
  17. alternateHeight : true,
  18. alternateHeightRange : {
  19. min : 175,
  20. max : 275
  21. },
  22. margin : 0
  23. });
  24. }
  25. }).attr('src',$img.attr('src'));
  26. });
  27. });
  28.  
  29.  
  30.  
  31.  
  32.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement