Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Idea: auto centering window #2

Open
jbanety opened this issue Oct 10, 2011 · 2 comments
Open

Idea: auto centering window #2

jbanety opened this issue Oct 10, 2011 · 2 comments

Comments

@jbanety
Copy link

jbanety commented Oct 10, 2011

How to center the window automatically ?

@farsider
Copy link

farsider commented Apr 2, 2012

replace

try{
var offsetTop = this.options.offsetTop || 40;
$("gyomModal").setStyles({
top: offsetTop,
left: ((window.getCoordinates().width - $("gyomModal").getCoordinates().width)/2 )
});
} catch(err){}
return;


with

try{
var offsetTop = this.options.offsetTop;
$("gyomModal").setStyles({
top: ((window.getCoordinates().height - $("gyomModal").getCoordinates().height)/2 ),
left: ((window.getCoordinates().width - $("gyomModal").getCoordinates().width)/2 )
});
} catch(err){}
return;


@HTMLGuyLLC
Copy link

jAlert auto centers: http://flwebsites.biz/jAlert/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants