[英]How to adjust inner div container height to fit with others divs
Please check the demo link I just want to adjust Geomap div's height to 100%. 请检查演示链接,我只想将Geomap div的高度调整为100%。 I have tried with this Javascript below but its overflowing with the footer.
我已经在下面尝试过使用此Javascript,但是页脚溢出了。
function handleResize() {
var h = $('html').height();
$('#map-geo').css({'height':h+'px'});
}
$(function(){
handleResize();
$(window).resize(function(){
handleResize();
});
});
Currently my Html and Body css is 目前,我的HTML和Body CSS是
html, body {
font-family: 'Open Sans', sans-serif;
-webkit-font-smoothing: antialiased;
height:69% !important;
width:100% !important;
}
Please do help me out to make it fit. 请帮我解决这个问题。
as far as i know you should replace : 据我所知,您应该更换:
$('#map-geo').css({'height':h+'px'});
with : 与:
$('#map-geo').css('height',h+'px');
And you also need to put the whole function into : 而且您还需要将整个函数放入:
$( document ).ready(function() {
});
You can try this, if it works for you : 如果可以使用,可以尝试一下:
$( document ).ready(function() {
function handleResize() {
var h = $('html').height();
$('#map-geo').css('height',h+'px');
}
handleResize();
});
This alone should resize the element. 仅此一项就应该调整元素的大小。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.