You need to sign in to do that
Don't have an account?
Michael Hedrick 2
How can you center a VF page center screen
Hello,
How can a VF page be centered in the users window? It either opens in left cowner or full screen.
Thanks,
M
How can a VF page be centered in the users window? It either opens in left cowner or full screen.
Thanks,
M
Try this to align the popup in the center :
var url='YOUR URL HERE';
var x = screen.width/2 - 700/2;
var y = screen.height/2 - 450/2;
window.open(url,'_blank','height=485,width=700,left='+x+',top='+y);
Or try this:
var url='YOUR URL HERE';
window.open(url,'Popup','height=400,width=1000,left=100,scrollbars=yes,top=100,toolbar=no,status=no');
Whichever works for you.
Let me know the results
All Answers
So do I reference the css like styleclass = "html"
And where do I reference it? in the apex;form ?
Thanks,
M
Raj,
I have tried moving the CSS syntax around but all I get is a white pop up.
Try putting your code between center tag.
Like this:
Let me know if it helps
Thanks
Tried to enclose the code between centertags earlier but it does not appear to make any difference.
Thanks,
M
Try this:
<center></center> tags are working as they should, aligning your page to center. How come you are not getting it in the center using center tags
I have values in the button - Window open property. I have a height and width value. I need the window to open a certain size. AMybe thats is why the window is not being centered when opening? I did not set the Window position in the button setting.
Here is a code snippet(written in javascript), you can use this as a reference:
This is tried and tested. All you have to do is just use it to your advantage.
Thanks,
M
Try this to align the popup in the center :
var url='YOUR URL HERE';
var x = screen.width/2 - 700/2;
var y = screen.height/2 - 450/2;
window.open(url,'_blank','height=485,width=700,left='+x+',top='+y);
Or try this:
var url='YOUR URL HERE';
window.open(url,'Popup','height=400,width=1000,left=100,scrollbars=yes,top=100,toolbar=no,status=no');
Whichever works for you.
Let me know the results
Thank you for the recomendation. With the values hard coded will the center position be based on the users monitor resolution?
If we can use JS in the button can I use the function shown in this (http://www.xtf.dk/2011/08/center-new-popup-window-even-on.html)example?
This is the code I used which may be a bit overkill.
And for reference the 800 and 500 value was used to match the window size in my VF page:
Thank you both for your help and persistence.
M