Search code examples
csssimplemodal

Can I add a CSS class to a SimpleModal instance?


Is there a way to assign ContainerClass instead of ContainerCss in Simple Modal?

I am working on a website which should be responsive based on which device is being used, so for example for iPad I want the width and height of container smaller than larger screens. I have a CSS class based on @Media and would like to know if I could assign a class instead of CSS which creates style attribute in simple-modal container div.

Thanks.


Solution

  • Some simple jQuery in a callback should do the trick:

    http://www.ericmmartin.com/projects/simplemodal/

    $("#myModal").modal( {
        onShow: function (dialog) {
            $(this).addClass('myClass');
        });
    }});