Fixed background image problem in IE11 and Window 10 - jumpy movement on scroll

Hey Kat,

So the problem here is related to the core bug where backslashes get stripped. Every time you visit the JS Code part in the customizer(where the IE code is), the backslashes get stripped, leaving you with an invalid code. You can place the code above again in the same place. Or transfer the code to your functions.php file. If so, the code should look like…

function fix_ie_bg() { ?>
  <script>
    jQuery( function() {
      if(navigator.userAgent.match(/Trident\/7\./)) { // if IE
        jQuery('body').on('mousewheel', function () {
          // remove default behavior
          event.preventDefault(); 
          //scroll without smoothing
          var wheelDelta = event.wheelDelta;
          var currentScrollPosition = window.pageYOffset;
          window.scrollTo(0, currentScrollPosition - wheelDelta);
        });
      }
    });
  </script>
<?php }
add_action( 'fl_head','fix_ie_bg' );

Let us know how it goes! :slight_smile:

Edit: Fixed the code(removed the second backslashes).

Ben

Hi Ben,

Thanks for the explanation and fix, it worked perfectly and is safely nestled in the child theme :slight_smile:

This can be applied to all devs going forward where IE is (sadly) preferred by the client and client user base. Secretly wishing they would just stop using it!

Thanks again - this is above an beyond and really appreciated!

Kat

No worries at all, Kat! Hopefully with the code above, you won’t bump into this issue anymore! :slight_smile: Have fun with BB! :slight_smile:

Ben