Team:Linkoping Sweden/popup

From 2014.igem.org

(Difference between revisions)
 
(2 intermediate revisions not shown)
Line 16: Line 16:
     display:none;
     display:none;
     z-index:9999;
     z-index:9999;
-
     padding:20px;
+
     padding:20px 0px;
}
}
/* Customize your modal window here, you can add background image too */
/* Customize your modal window here, you can add background image too */
Line 54: Line 54:
             var winH = $(window).height();
             var winH = $(window).height();
             var winW = $(window).width();
             var winW = $(window).width();
 +
            if($(id).height() > winH) {
 +
                $(id).css('height', winH);
 +
            }
 +
            if($(id).width() > winW) {
 +
                $(id).css('width', winW);
 +
            }
             //Set the popup window to center
             //Set the popup window to center
             $(id).css('top', winH/2-$(id).height()/2);
             $(id).css('top', winH/2-$(id).height()/2);
Line 72: Line 78:
         //if mask is clicked
         //if mask is clicked
         $('#mask').click(function (e) {
         $('#mask').click(function (e) {
-
        e.stopPropagation();
+
            e.preventDefault();
 +
            e.stopPropagation();
             $(this).hide();
             $(this).hide();
             $('.window').hide();
             $('.window').hide();

Latest revision as of 09:27, 16 October 2014