Guest User

Untitled

a guest
May 31st, 2016
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. $('.a2paragraph .image img').each(function() {
  2. var img = $('.a2paragraph .image img');
  3.  
  4. var h = document.getElementById('img').height(),
  5. w = document.getElementById('img').width();
  6.  
  7. if (h > w) {
  8. img.parent().css('height', w);
  9. }
  10. else if (w < h) {
  11. img.parent().css('width', h);
  12. }
  13.  
  14.  
  15. });
Advertisement
Add Comment
Please, Sign In to add comment