Guest User

Untitled

a guest
Jul 18th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. function resizeModal() {
  2. var viewportHeight = $(window).height();
  3. var modalHeight = $(".modalPopup").height();
  4. var maxModalHeight = viewportHeight - (.25 * viewportHeight);
  5.  
  6. if (modalHeight < viewportHeight) {
  7. $(".modalPopup").css("height", "auto");
  8. }
  9. else if (modalHeight > viewportHeight) {
  10. $(".modalPopup").addClass("scrollableModal").css("height", maxModalHeight + "px");
  11. }
  12. }
  13.  
  14. $(document).ready(function() {
  15. resizeModal();
  16. });
  17.  
  18. $(window).bind('resize', function() {
  19. resizeModal();
  20. });
Add Comment
Please, Sign In to add comment