我是JavaScript和jQuery的新手,可能犯过一个简单的错误,所以请容忍我。
我有一个填充窗口高度的div,但我希望我的h1元素是页面下窗口高度的28% (填充)
$(document).ready(function() {
function setHeight() {
windowHeight = $(window).innerHeight();
$('.fullscreen').css('min-height', windowHeight);
};
function imageAjust() {
var ajustAmt = windowHeight * 28 / 100;
$('.fullscreen').css('padding-top', ajustAmt + 'px');
};
});
编辑:在ajustAmt末尾添加px代码
提前感谢你的帮助
https://stackoverflow.com/questions/38375297
复制