jQuery UI Widgets Forums Dialogs and Notifications Window window popup always center vertically

This topic contains 6 replies, has 5 voices, and was last updated by  Peter Stoev 9 years, 3 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
  • window popup always center vertically #47850

    emden
    Participant

    is there a way to Always center the window vertically. even when scolling the webpage vertically.

    now when scolling the vertically and then opening a window, The window popup is at the top of the webpage and not centered.

    kind regards,

    Edwin

    window popup always center vertically #47994

    Dimitar
    Participant

    Hello Edwin,

    Before opening the window, you can call the move method as follows:

    $("#jqxwindow").jqxWindow("move", $(window).width() / 2 - $("#jqxwindow").jqxWindow("width") / 2, $(window).height() / 2 - $("#jqxwindow").jqxWindow("height") / 2);

    Best Regards,
    Dimitar

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

    window popup always center vertically #48460

    jimg
    Participant

    Why isn’t this the default behavior?

    window popup always center vertically #48478

    Peter Stoev
    Keymaster

    Hi jimg,

    The default behavior is the window to be centered in the browser’s window. That is how we think it should work.

    Best Regards,
    Peter Stoev

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

    window popup always center vertically #48539

    jimg
    Participant

    I agree, windows should be centered vertcially. But windows are NOT centered vertically if you have a long page that’s scrolled down. Instead the window appears near the top of the page, centered as if the page wasn’t scrolled. It seems that your code that centers the window vertically doesn’t take account of the window scrollTop value.

    window popup always center vertically #67682

    asies
    Participant

    I’ve had a similar issue to jimg:
    I have a long page, and need to show a jqxWindow in the middle of the window when the page is scrolled to the bottom.
    The default behaviour is that it appears nearer the top of the page, so the user can only see it if they scroll up.
    Unfortunately, for other reasons, my jqxWindow needs to have ‘auto’ height, so Dimitar’s method for moving the jqxWindow doesn’t work.

    It would be great to know about any workarounds you’d recommend for this particular situation. Thanks 🙂

    window popup always center vertically #67710

    Peter Stoev
    Keymaster

    Hi asies,

    The window’s default positioning centers it in the Screen. There are methods which allow you to change its position. You can use the “move” method

    Best Regards,
    Peter Stoev

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

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

You must be logged in to reply to this topic.