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

Set delay on hide functions to smooth mobile rendering

parent fd66c5ec
...@@ -11,11 +11,11 @@ $(document).ready(function(){ ...@@ -11,11 +11,11 @@ $(document).ready(function(){
$(this).parent().toggleClass('active'); $(this).parent().toggleClass('active');
// Replace "About" link with the close icon // Replace "About" link with the close icon
$('#about-link-text, #about-close-nav').toggle(); $('#about-link-text, #about-close-nav').toggle();
// Prevent body from scolling when about section is active // Hide grid to disable scrolling when info body is active
$('.main-container').slideToggle(500); // The delay prevents buggy scrolling on some mobile browsers
// Scroll back to top window.setTimeout(function() { $('.main-container').toggle() }, 350);
$('html, body').animate({ $('html, body').animate({
scrollTop: 0 scrollTop: 0
}, 500); }, 500);
}); });
$('#about-close').click(function(){ $('#about-close').click(function(){
......
...@@ -95,12 +95,9 @@ $(document).ready(function() { ...@@ -95,12 +95,9 @@ $(document).ready(function() {
lastClicked = grid_id; lastClicked = grid_id;
} }
if ($(window).width() < 992) { if ($(window).width() < 992) {
// On mobile displays, hide grid to disable scrolling when info body is active // On mobile displays, hide grid to disable scrolling when info body is active
$('.main-container').slideToggle(500); // The delay prevents buggy scrolling on some mobile browsers
// Scroll to top of page to prevent body from going out of view window.setTimeout(function() { $('.main-container').toggle() }, 350);
$('html, body').animate({
scrollTop: 0
}, 430);
} }
}); });
$('#info-close').click(function() { $('#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