Auto resize to fit HTML content? Difficult to style nicely at the moment.

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Auto resize to fit HTML content? Difficult to style nicely at the moment.

James Harvard
Am I missing some obvious way to set the size to fit HTML content without having to hard-code pixel dimensions? Obviously these can change if the user alters the text size or if the content is edited.

Needless to say it is not ideal if the content has to be scrolled or has uneven margins in a Shadowbox overlay that is the wrong size.

IIRC with jQueryUI dialogues if the width is set the height will adjust to fit the content automatically.

If this is not currently possible, please consider this a feature request!
Jon
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Auto resize to fit HTML content? Difficult to style nicely at the moment.

Jon
Hi, has anyone found a solution to this yet? Shadowbox is so awesome by the way and I hope this is something that can be done.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Auto resize to fit HTML content? Difficult to style nicely at the moment.

James Harvard
No, I'm afraid I gave up and just used a jQuery UI dialog widget, since that automatically adjusts its height to fit the content (given a fixed width).
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Auto resize to fit HTML content? Difficult to style nicely at the moment.

arttronics
I recently found this article that shows how to modify shadowbox v3.0.3 to have it resize HTML content dynamically: Customizing a JavaScript Shadowbox

When posting your markup here on the forum follow these simple steps:

0. Login and paste your markup into the Message Box.
1. Mouse select the markup you just pasted.
2. Press the More Button from the Message Box Toolbar.
3. Select Raw text from the drop down menu. DONE!

If I don't respond to your POST, it's your inability to provide your markup correctly.

Check out a few DEMOS I made that are here in this forum.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Auto resize to fit HTML content? Difficult to style nicely at the moment.

Marcin
In reply to this post by James Harvard
I used that piece of code on the page displayed within Shadowbox window and it works for me:

    parent.$("#sb-wrapper").width(300);
    parent.$("#sb-wrapper-inner").height(200);
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Auto resize to fit HTML content? Difficult to style nicely at the moment.

r9software
In reply to this post by Jon
in the line 204, (with netbeans or whatever, rigth clic format)
oversized: false
that will help you.
in the line 1671
 K.height = S.height;
            K.width = S.width;
thats all
Loading...