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

@@ -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);
}