非常に単純な問題ですが、私は JavaScript を初めて使用します。 と の両方でJS を使用してmargin-top
プロパティを追加しようとしていますが、うまくいきません。div
document.ready
window.resize
function cent() {
var blockheight = $("#block").height();
var margintop = (blockheight / -2);
$block.css("margin-top", margintop);
};
$(document).noConflict();
$(document).ready(cent);
$(window).resize(cent);