scrollElement.length

This commit is contained in:
Mike Jolley 2017-11-08 14:12:36 +00:00
parent e14814aa2a
commit e7f1a3f22f
1 changed files with 2 additions and 2 deletions

View File

@ -515,11 +515,11 @@ jQuery( function( $ ) {
var scrollElement = $( '.woocommerce-NoticeGroup-updateOrderReview, .woocommerce-NoticeGroup-checkout' ),
isSmoothScrollSupported = 'scrollBehavior' in document.documentElement.style;
if ( ! scrollElement ) {
if ( ! scrollElement.length ) {
scrollElement = $( '.form.checkout' );
}
if ( scrollElement ) {
if ( scrollElement.length ) {
if ( isSmoothScrollSupported ) {
scrollElement[0].scrollIntoView({
behavior: 'smooth'