jQWidgets Forums
jQuery UI Widgets › Forums › Dialogs and Notifications › Window › Binding Function on window Collapse
Tagged: jquery dialog, php window, window widget
This topic contains 3 replies, has 2 voices, and was last updated by Minko 12 years, 9 months ago.
-
Author
-
I have a page using multiple of these windows stacked on top of one another. I can’t seem to find a collapse event to bind a hideshow function to them so that, upon collapse, there won’t be excess whitespace on the page. Any suggestions?
Thank you in advance.
Hello Royroy,
you can bind to the collapse event using the jQuery bind method:
JavaScript
$('#window').bind('collapse', function () { alert('The window have been collapsed!');});
The code above will cause alert everytime you collapse the jqxWindow with id window.
Best regards,
MinkojQWidgets Team
http://jqwidgets.com/Minko,
This solution is not working. The API makes no mention of a collapse event. Are you sure that we are able to bind to one?
Thank you
Hello Royroy,
There is ‘collapse’ event and it is raised when the window is collapsed. I just tested it again and it works as expected.
You can bind to the collapse event using the jQuery bind method:
JavaScript
$('#window').bind('collapse', function () { alert('The window have been collapsed!');});
Working sample:
<!DOCTYPE html><html lang="en"><head> <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" /> <script type="text/javascript" src="../../scripts/gettheme.js"></script> <script type="text/javascript" src="../../scripts/jquery-1.7.2.min.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxwindow.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxscrollbar.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxpanel.js"></script> <script type="text/javascript"> $(document).ready(function () { $('#window').jqxWindow({ height: 145, width: 270, showCollapseButton: true}); $('#window').bind('collapse', function() { alert('collapsed'); }); }); </script></head><body class='default'> <div id="window"> <div>Title</div> <div>Content</div> </div></body></html>
Best regards,
MinkojQWidgets Team
http://jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.