Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function resizeModal() {
- var viewportHeight = $(window).height();
- var modalHeight = $(".modalPopup").height();
- var maxModalHeight = viewportHeight - (.25 * viewportHeight);
- if (modalHeight < viewportHeight) {
- $(".modalPopup").css("height", "auto");
- }
- else if (modalHeight > viewportHeight) {
- $(".modalPopup").addClass("scrollableModal").css("height", maxModalHeight + "px");
- }
- }
- $(document).ready(function() {
- resizeModal();
- });
- $(window).bind('resize', function() {
- resizeModal();
- });
Add Comment
Please, Sign In to add comment