| Issue 25: | Enhancement: resizing the modal window | |
| 2 people starred this issue and may be notified of changes. | Back to list |
When opening AJAX content, the modal window is properly sized with no scroll bars. However, when I add/remove DOM elements, scroll bars appear but do disappear after. It would be great to actually resize the modal window unless the content becomes larger than certain are. For instance, jqModal does that. Any ideas? :)
Jun 9, 2008
Project Member
#1
nyro...@gmail.com
Labels:
-Type-Defect Type-Other
Jun 10, 2008
Thanks for your reply. An example would be nice (how do I get the new window's size?), although I am afraid the modal window's behavior might be jerky.
Jun 13, 2008
Let say you have a link a.addContent in your Ajax Content.
You can use this code:
$(function() {
$.fn.nyroModal.settings.endFillContent: function(elts, settings) {
$('a.addContent', elts.content).click(function(e) {
e.preventDefault();
elts.content
.css({
width: 'auto',
height: 'auto'
})
.append(' Content Added');
$.nyroModalSettings({
width: elts.content.width(),
height: elts.content.height()
});
});
};
});
Basically, I'm using the endFillContent callback to create the click action in the link.
We have to set the height and width to auto to retrieve the new height and width as
well. I'm not sure if it will works great regarding the width, I didn't make to much
test.
Then, I'm calling the nyroModalSettings function to set the new height and width.
Then, the modal is resized with the resize animation callback..
Hope it will works for you.
Don't hesitate to send a link of the live site!
Status:
Fixed
May 15, 2010
Does this solution still work (maybe there was an API change?)??? I am trying to use it
with the latest versions of jquery and nyromodal, but no luck. I get the following error:
Error: invalid label
Source Code:
$.fn.nyroModal.settings.endFillContent: function(elts, settings) {
|