Subscribe For Free Updates!

We'll not spam mate! We promise.

May 2, 2013

JQuery to Find window Height


JQuery to set div in center of screen:

 The following code is used to find the center position of the any size of the screen. here i set the div in center of the screen using jquery.

  "$(window).height()" this function is used to get hight of the window(Screen).


var divCenter= $('#div_id');
divCenter.css("top", ($(window).height() - divCenter.height())/2  + 'px');

You can change this code whatever you find like screen height, width etc.

TechniqZone Socializer Widget
SOCIALIZE IT →
FOLLOW US →
SHARE IT →

0 comments:

Post a Comment