From caa978cf2d42cccb2f08a426978e6386cf4f73fa Mon Sep 17 00:00:00 2001 From: Peter Fabian Date: Mon, 6 Aug 2018 19:56:09 +0200 Subject: [PATCH] Use jQuery for scrolling to element for all browsers to avoid special cases. --- assets/js/frontend/woocommerce.js | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/assets/js/frontend/woocommerce.js b/assets/js/frontend/woocommerce.js index b5b5e835233..3183d98e08a 100644 --- a/assets/js/frontend/woocommerce.js +++ b/assets/js/frontend/woocommerce.js @@ -66,19 +66,10 @@ jQuery( function( $ ) { // Common scroll to element code. $.scroll_to_notices = function( scrollElement ) { - var isSmoothScrollSupported = 'scrollBehavior' in document.documentElement.style; - if ( scrollElement.length ) { - if ( isSmoothScrollSupported ) { - scrollElement[0].scrollIntoView({ - behavior: 'smooth', - block: 'center' - }); - } else { - $( 'html, body' ).animate( { - scrollTop: ( scrollElement.offset().top - 100 ) - }, 1000 ); - } + $( 'html, body' ).animate( { + scrollTop: ( scrollElement.offset().top - 100 ) + }, 1000 ); } }; });