jQuery UI Widgets Forums Dialogs and Notifications Window Create Function for a general window?

This topic contains 1 reply, has 2 voices, and was last updated by  Dimitar 10 years, 10 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Create Function for a general window? #48237

    realtek
    Participant

    Hi,

    I have a site will be opening quite a few windows and I wanted to make it a bit more object orientated.

    The jqxWindow is great but if you want to have several windows displaying different content when different buttons are clicked, there is a lot of re-inventing the wheel.

    I would ideally like a common function such as createWindow() which you could pass the ID of a div to and perhaps the width and height which would then display a window.

    Does anyone have any examples of how this could be done?

    Thanks!

    Create Function for a general window? #48252

    Dimitar
    Participant

    Hello realtek,

    Here is an example of such function:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <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>
    </head>
    <body>
        <div id='content'>
            <script type="text/javascript">
                $(document).ready(function () {
                    var createWindow = function (id, width, height) {
                        $("#" + id).jqxWindow({ width: width, height: height });
                    };
    
                    createWindow("jqxwindow", 200, 150);
                });
            </script>
            <div id='jqxwindow'>
                <div>
                    Header</div>
                <div>
                    Content</div>
            </div>
        </div>
    </body>
    </html>

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

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

You must be logged in to reply to this topic.