align_div_vertically.js

var div_to_be_aligned = $('#middle'); var new_margin_top = 0; var descontos = 0; new_margin_top = (document.height - descontos - div_to_be_aligned.height()) / 2; new_margin_top = new_margin_top + descontos / 2; div_to_be_aligned.css('margin-top', new_margin_top + 'px');
Align a div vertically on the screen

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.