Skip to content

Commit

Permalink
fix height
Browse files Browse the repository at this point in the history
  • Loading branch information
G1enB1and committed Jan 22, 2019
1 parent 2cd1765 commit 8a68d9f
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions Index.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,17 @@ <h1>Coffee Shop Locations</h1>
// Flex does not work properly with google maps to fill remaining height as it would with an image.
// The header at 50px and 2 borders at 1px each extend the map size beyond 100% by 52px.
// TODO: change to knockout observables to update when changed.
// Set initial height of map to height of map_container - 52px (JQuery method)
$('#map').height($('#map_container').height()-52);
// set initial height of options-box to itself - 52px (JQuery method)
$('.options-box').height($('.options-box').height()-12);
// set initial height of header_ma_wrapper to itself - 52px (JQuery method)
$('.header_map_wrapper').height($('.header_map_wrapper').height()-52);
function fixHeight() {
// Set initial height of map to height of map_container - 52px (JQuery method)
$('#map').height($('.container').height()-52);
// set initial height of options-box to itself - 52px (JQuery method)
$('.options-box').height($('.container').height()-12);
// set initial height of header_ma_wrapper to itself - 52px (JQuery method)
$('.header_map_wrapper').height($('.container').height()-52);
}
fixHeight();
$(window).resize(fixHeight);

</script>

<!-- google maps initMap callback script-->
Expand Down

0 comments on commit 8a68d9f

Please sign in to comment.