Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- screen.height;
- screen.width;
- var div= $('#div_SomeDivYouWantToAdjust');
- div.css("top", ($(window).height() - div.height())/2 + 'px');
- var obj = $("#divID");
- var halfsc = $(window).height()/2;
- var halfh = $(obj).height() / 2;
- var halfscrn = screen.width/2;
- var halfobj =$(obj).width() / 2;
- var goRight = halfscrn - halfobj ;
- var goBottom = halfsc - halfh;
- $(obj).css({marginLeft: goRight }).css({marginTop: goBottom });
Add Comment
Please, Sign In to add comment