My favorites | Sign in
Project Home Downloads Issues
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 467: Autoresize nyroModal window
4 people starred this issue and may be notified of changes. Back to list
Status:  New
Owner:  ----


 
Reported by goodlady...@gmail.com, Apr 29, 2010
I'm trying to get resize nyroModal window to iframe content width and
height manually.

on first page - just link with class nyroModal and target _blank
on second page - link with the same attrs
on third page - in head js code

jQuery(document).ready(function($){
	$.nyroModalSettings({
		resize: function (elts, settings, callback) {
			elts.started({height:400});
		}
	});
});

and some content with the width 800 and height 900px.

But window not resize. And if I load any over page, width and height of
nyroModal window still the same as default settings. But if I load an image
it's works as expected.

PS! FF3.0, JQuery 1.4.2
Apr 29, 2010
Project Member #1 nyro...@gmail.com
Are the pages all on the same domain than the opener?

Then, your code should looks like:
jQuery(document).ready(function($){
	parent.$.nyroModalSettings({
		width: ''
	});
});

Apr 29, 2010
#2 goodlady...@gmail.com
Yes, all pages on the same domain. Third page load some content into div from other
domain. But problem isn't this.

I've try code provided by you. Nothing changes. nyroModal window still with the
default sizes.

And I don't understand, why nyroModal not resizing itself automaticaly, while loading
iframe content.
Aug 5, 2010
#3 jared.le...@gmail.com
I am experiencing the same behavior. I have one iframe open (using the classname [<a href='<%=ResolveClientUrl("~/Account/login.aspx") %>' target="_blank" class="nyroModal Link-White">Login</a>] method)

NOTE: Obviously, I am using .NET

That window (login) just happens to fit into the default size (or so it seems...I do not set any height or width). If a user is not a member, i have a link in this page to become a member. From the "become a member" link, I fire some js to open a fake (hidden link) on my materpage that then opens the new page (register) in a nyroModal (had to do this because opening manually worked worse than this method - had to set an incredibility high setTimout to make it close the open window and then open a new window). When the new nyroModal (register) opens, it seems to "want" to resize, but never gets it correct... only grows about 20 pixels (in height, never width)... Don't know how to fix this issue. 

Also, this methodology I am describing doesn't work in FF...does't even grow the 20px.

I am attaching a screenshot... 

see code below

Login Link:<a href='<%=ResolveClientUrl("~/Account/login.aspx") %>'
                    target="_blank" class="nyroModal Link-White">Login</a>

Fake (Register) Link: <a id="lnkRegisterUser" href='<%=ResolveClientUrl("~/Account/Register.aspx") %>'
                    target="_blank" class="nyroModal" style="display:none;">Login</a>

Register Link (from login page):  <div style="text-align: right;">
                            Not a member? Sign up <span class="Link-Blue" onclick="OpenSignUp({Url:'<%=ResolveUrl("~/Account/Register.aspx") %>'});">
                                here</span></div>
JS:

//Global Settings for Modal popup
$(document).ready(function () {
    $.nyroModalSettings({ zIndexStart: 5000,
        bgColor: '#3399CC',
        resizable: true,
        autoSizable: true,
        padding: 20,
        title: null,
        titleFromIframe: false,
        endRemove: null
    });
});

function OpenSignUp(Args) {
    if(parent)
        parent.$('#lnkRegisterUser').click();
    else
        $('#lnkRegisterUser').click();
}

That's about it... hope this helps to track down the issue...
Logon.PNG
8.8 KB   View   Download
register.PNG
11.1 KB   View   Download
Oct 17, 2011
#4 panagi...@gmail.com
I got all sort of problems with iframe size as I use it to open different pages from different domains.

Is there a way to setup nyromodal to automatically obtain target iframe size or at least accept some predefined values that will work ?


Here is my case:

I am already using it nested with parent like:
<script type="text/javascript">
$(function() {
  $('#myLink').click(function(e) {
    e.preventDefault();
    parent.$.nyroModalManual({
      url: 'index.php'
    });
  });
});
</script>

while at index.php

<script type="text/javascript">
$(window).load(function () {
  
  $(function() {
	var width = 500;
	var height = 470;
$('.nyroModal').nyroModal({
  sizes: {
    initW: width, initH: height,
    minW: width, minH: height,
    w: width, h: height
  }
});
});
  
  
});

</script>

The first window that opens is an iframe (it loads from CSS and can be from same OR different domain). The size set in index.php works for windows opened from the same domain.

However,, I might open another iframe of another window size. This messes up selections so I ended up setting high values in CSS for iframe so I do not end up with bars at second iframe window. 

Finally, at first page even if I open a window of same domain, it uses the width and height of iframe.

(The links usage is just simple, just adding the class in the link)

I find nyromodal excellent on other fronts but window sizing is really troublesome.

Powered by Google Project Hosting