Created
July 20, 2015 12:26
-
-
Save chrdesigner/5a54674d9ea74ffdd447 to your computer and use it in GitHub Desktop.
Vertical Align with jQuery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function() { | |
$('.classVerticalAlign').css({ | |
'position' : 'absolute', | |
'left' : '50%', | |
'top' : '50%', | |
'margin-left' : -$('.classVerticalAlign').outerWidth()/2, | |
'margin-top' : -$('.classVerticalAlign').outerHeight()/2 | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment