diff options
author | Matthew Somerville <matthew@mysociety.org> | 2012-03-01 15:40:39 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2012-03-01 15:40:39 +0000 |
commit | e56fd090eeb9667c90b9709dfa0c8045a45f27e2 (patch) | |
tree | 7d9f4c7d934bbef4dcf167aaa5ab4d915604c7aa | |
parent | d6d3a2904cafa7236b5426a9d19f0807c28e153f (diff) |
Better way of fixing size of map, and hide URL bar, fixes #266 (not sure we'll keep it though).
-rw-r--r-- | web/cobrands/fixmystreet/fixmystreet.js | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js index cdf1c6af7..f97476910 100644 --- a/web/cobrands/fixmystreet/fixmystreet.js +++ b/web/cobrands/fixmystreet/fixmystreet.js @@ -84,7 +84,9 @@ $(function(){ // Immediately go full screen map if on around page $('#site-header').hide(); $('#map_box').prependTo('.wrapper').css({ - height: $(window).height(), + position: 'absolute', + top: 0, left: 0, right: 0, bottom: 0, + height: 'auto', margin: 0 }); $('.big-green-banner') @@ -371,3 +373,14 @@ $(function(){ } }); }); + +// Hide URL bar +$(window).load(function(){ + window.setTimeout(function(){ + var s = window.pageYOffset || document.compatMode === "CSS1Compat" && document.documentElement.scrollTop || document.body.scrollTop || 0; + if (s < 20 && !location.hash) { + window.scrollTo(0, 1); + } + }, 0); +}); + |