horgen
horgen

Reputation: 2203

nyroModal - how to configure the width and height of the modal box

I am trying to controll the width and height of the modal window, but I have no idea how to override the default settings.

I've been looking at the nmObject (http://nyromodal.nyrodev.com/), but my javascript knowledge is not that great and I have no idea what the correct way to implement this is.

Here is my attempt, but with a syntax error:

$.nmObj( sizes: { initW: 300, initH: 300 });

What am I doing wrong? :\

EDIT:

$(function() {
  $('.nyroModal').nyroModal();
  $.nmObj({sizes: { initW: 300, initH: 300 }});
});

No syntax errors atleast, but I don't think im using the function correctly

Upvotes: 1

Views: 10697

Answers (4)

irinal
irinal

Reputation: 1

For this filter

.* Iframe filter

.* Before: filters.formFile

Locate in min.js the file is part of a string load: function (nm) { nm.store.iframe = $('<iframe />').attr({ src: 'javascript:\'\';', id: 'nyromodal-iframe-' + (new Date().getTime()), frameborder: '0' })

and add

.css({ height: nm.sizes.h })

the result should be

load: function (nm) { nm.store.iframe = $('<iframe />').attr({ src: 'javascript:\'\';', id: 'nyromodal-iframe-' + (new Date().getTime()), frameborder: '0' }).css({ height: nm.sizes.h })

Upvotes: 0

cyberhobo
cyberhobo

Reputation: 656

Looks like you're using nyroModal v2. For an iframe, you need to set the initial size in the CSS:

.nyroModalCont iframe {
    width: 300px;
    height: 300px;
}

There's a github issue for this, which is closed, so I think that's how it will work in this version.

Ivailo's answer applies to nyroModal v1, I believe.

Upvotes: 3

Ivailo Bardarov
Ivailo Bardarov

Reputation: 3895

Another way of doing it.

<script type="text/javascript">
  $(document).ready(function() {
    $.nyroModalSettings({
      type: 'iframe',
      height: 500,
      width: 700,
      resizable: true,
      autoSizable: true,
      titleFromIframe: true,
      // modal: true,
      // selIndicator: '#loading',
      contentLoading: "" // use our own
    });

    $('a.nyroModalPhotos').nyroModal();
  });
</script>

Upvotes: 2

alexl
alexl

Reputation: 6851

try:

$.nmObj({sizes: { initW: 300, initH: 300 }});

Hope it helps.

Upvotes: 4

Related Questions