jQWidgets Forums
jQuery UI Widgets › Forums › Dialogs and Notifications › Window › Window auto width and height
This topic contains 5 replies, has 4 voices, and was last updated by Peter Stoev 11 years, 5 months ago.
-
Author
-
Is any way to make a kind of auto size for window…like the more the window have content..the more the size increase…It could help to avoid some scroolbar..???
Hello Dundee,
To achieve this, please set the width and height properties to “auto”, e.g.:
<!DOCTYPE html><html lang="en"><head> <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" /> <script type="text/javascript" src="../../scripts/jquery-1.10.2.min.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxwindow.js"></script> <script type="text/javascript"> $(document).ready(function () { $('#window').jqxWindow({ width: 'auto', height: 'auto' }); }); </script></head><body class='default'> <div id="window"> <div> Title</div> <div> Very Long Content<br /> Very Long Content<br /> Very Long Content</div> </div></body></html>
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/The ‘auto’ parameter value for the width and height properties does not work for me. Only a very small amount of the window content is shown, and scroll bars are shown instead. In my case the window would need to be at least 5 or 6 times as big as it is shown by default. My window statement is as follows:
$(“#selectOrder”).jqxWindow({ theme: xxxxxxxx.theme, isModal: true, position: { x: 160, y: 170 }, width:’auto’, height:’auto’, animationType:’none’, autoOpen: false });
My window content is one line of text, followed by a table with 2 rows and 4 columns that contain text and links, followed by a link. The table content is generated dynamically from results of an ajax call. However the window size isn’t even big enough to show the first line of static text.
This is basic window functionality. What do I need to do to make this work?
Please disregard my last post. I found the answer in another post that says you need to populate the contents div in the window before showing it. That indeed does work.
The ‘auto’ parameter doesn’t work correctly for IE8 and IE9. Even if I set all the HTML content in the window before calling jqxWindow(), the horizontal size stretches out beyond the right edge of the browser, and the height is too short. Is this just a result of not supporting older versions of IE? We have plenty of users who use IE8 & 9.
Hi jimg,
We do support old browsers, but we are not those that decide how an old browser will auto-size a content with “auto” setting. In addition, you should take into account what kind of HTML you place in a window, because for example DIV tags are not auto-sized. DIV tags are usually stretched horizontally.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.