jQWidgets Forums

jQuery UI Widgets Forums Dialogs and Notifications Window Binding Function on window Collapse

This topic contains 3 replies, has 2 voices, and was last updated by  Minko 12 years, 9 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • Binding Function on window Collapse #6016

    royroy
    Member

    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.

    Binding Function on window Collapse #6032

    Minko
    Blocked

    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,
    Minko

    jQWidgets Team
    http://jqwidgets.com/

    Binding Function on window Collapse #6391

    royroy
    Member

    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

    Binding Function on window Collapse #6392

    Minko
    Blocked

    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,
    Minko

    jQWidgets Team
    http://jqwidgets.com/

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.