jQWidgets Forums

jQuery UI Widgets Forums Getting Started Get the position of a window when its released from moved

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 11 years, 8 months ago.

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

  • DiegoUnanue
    Participant

    I’m getting the position of a window when it’s opened like this:

    $('#windowAdConsole').on('open', function(event) {
    
        $('#windowAdConsole').jqxWindow('bringToFront');
    
        xPosPrev = xPosNew;
        yPosPrev = yPosNew;

    //Here I get the position

            $('#windowAdConsole').jqxWindow({ position: { x: xPosPrev + 20, y: yPosPrev + 20} });
        position = $('#windowAdConsole').jqxWindow('position');
        xPosNew = position.x;
        yPosNew = position.y;
    
    });

    But when I moved and release the position, I don’t get the position moved but the inicial position when it’s opened. For example the inicial position of the window is x: 200 y:200, then I moved it and I get again the same values. The code used to moved it is:

        $('#windowAdConsole').on('moved', function (event) {
        position = $('#windowAdConsole').jqxWindow('position');
        xPosNew = position.x;
        yPosNew = position.y;
    });

    How can I get the new moved position of the window?


    Peter Stoev
    Keymaster

    Hi DiegoUnanue,

    The “position” property does not change as it represents the initial display position of the window. $(‘#windowAdConsole’).offset() returns the window’s position.

    Best Regards,
    Peter Stoev

    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.