Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有以下代码,而不是 height(300),height() = document height-100
$(".bar").height(XXX);
var DocHeight = $(document).height(); $(".bar").height(DocHeight-100);
试试这个:
var h = $(window).height() - 100; $(".bar").height(h);