jQuery UI Widgets › Forums › General Discussions › Dialogs and Notifications › Window › window popup always center vertically
This topic contains 6 replies, has 5 voices, and was last updated by Peter Stoev 10 years, 8 months ago.
-
Author
-
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
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,
DimitarjQWidgets team
http://www.jqwidgets.com/Why isn’t this the default behavior?
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 StoevjQWidgets Team
http://www.jqwidgets.com/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.
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 🙂
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 StoevjQWidgets Team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.