Skip to content

Latest commit

 

History

History
9 lines (8 loc) · 441 Bytes

README.md

File metadata and controls

9 lines (8 loc) · 441 Bytes

Screenutil.js

is a simple javascript "object" or "class" that can be used to get the center position of your screen, it was originally created to help in displaying modal windows and making sure they are always on the middle of the page.

(function(d, c){
	d.style.left = c.x - ( d.style.width / 2 );
	d.style.top = c.y - ( d.style.height / 2 );
}( document.getElementById('test'),	screenutil.getScreenCenter() ));