Search code examples
responsive-designmodal-dialogsimplemodal

Getting Simplemodal to work responsively


I have managed to get simplemodal working--very happy with it--but I would like to get it working responsively; any suggestions? On smaller viewports the modal-window extends out of the viewport. Have I missed something in the options that already does what I want?

Alternatively what can I do with smaller viewports? Turn it off?


Solution

  • I could not get the modals to work so I have relied on the fall back I alreay put in place for no js. Quite simply I'm turning the modals off when the screen size becomes troubling.

    (function() {
      if (viewport.width() >= 705) {
        modal code here
      }
    }());