Commit 2283645e authored by Renfred Harper's avatar Renfred Harper

Set delay on hide functions to smooth mobile rendering

parent fd66c5ec
......@@ -11,11 +11,11 @@ $(document).ready(function(){
$(this).parent().toggleClass('active');
// Replace "About" link with the close icon
$('#about-link-text, #about-close-nav').toggle();
// Prevent body from scolling when about section is active
$('.main-container').slideToggle(500);
// Scroll back to top
// Hide grid to disable scrolling when info body is active
// The delay prevents buggy scrolling on some mobile browsers
window.setTimeout(function() { $('.main-container').toggle() }, 350);
$('html, body').animate({
scrollTop: 0
scrollTop: 0
}, 500);
});
$('#about-close').click(function(){
......
......@@ -95,12 +95,9 @@ $(document).ready(function() {
lastClicked = grid_id;
}
if ($(window).width() < 992) {
// On mobile displays, hide grid to disable scrolling when info body is active
$('.main-container').slideToggle(500);
// Scroll to top of page to prevent body from going out of view
$('html, body').animate({
scrollTop: 0
}, 430);
// On mobile displays, hide grid to disable scrolling when info body is active
// The delay prevents buggy scrolling on some mobile browsers
window.setTimeout(function() { $('.main-container').toggle() }, 350);
}
});
$('#info-close').click(function() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment