Guest User

Untitled

a guest
Jan 12th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. box to keep proportion when scaling with javascript
  2. if (height > width)
  3. calculate the height
  4. calculate the width
  5. if (width > div.width)
  6. width = div.width
  7. height = div.width * aspect;
  8.  
  9. ....
  10.  
  11. height = parseInt($('#height').val()) || 0;// making 0 as default value.
  12. width = parseInt($('#width').val()) || 0;
  13. ....
Add Comment
Please, Sign In to add comment