more robust crossbrowser support

This commit is contained in:
Mario Vavti 2016-12-22 11:54:04 +01:00
parent f2bfdfdedd
commit 2ce6d47519
3 changed files with 26 additions and 3 deletions

View File

@ -15,12 +15,14 @@ main {
}
aside {
position: relative;
display: table-cell;
vertical-align: top;
padding: 71px 7px 0px 7px;
}
section {
position: relative;
width: 100%;
display: table-cell;
vertical-align: top;

View File

@ -23,7 +23,6 @@ body {
margin: 0px;
height: 100%;
overflow-x: hidden;
}
aside {
@ -46,6 +45,16 @@ main {
max-width: $main_widthpx;
}
#overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
cursor: pointer;
z-index: 1029;
}
h1, .h1 {
font-size: 2em;
}

View File

@ -92,7 +92,19 @@ function makeFullScreen(full) {
}
function toggleAside() {
$(window).scroll();
$('#expand-aside-icon').toggleClass('fa-arrow-circle-right').toggleClass('fa-arrow-circle-left');
$('main').toggleClass('region_1-on');
if($('main').hasClass('region_1-on')){
$('main').removeClass('region_1-on')
$('#overlay').remove();
}
else {
$('main').addClass('region_1-on')
$('<div id="overlay"></div>').appendTo('section');
}
$(window).scroll();
// work around a bug where a browser seems to not trigger scroll with $(window).scroll()
var scrollpos = $(window).scrollTop();
$(window).scrollTop(scrollpos - 1);
setTimeout(function(){ $(window).scrollTop(scrollpos) }, 100);
}