-1

I noticed that on IE11 this script is really messing up the scrolling. Other browsers are fine. So I was wondering how to exclude it only on IE11.

  var $t            = $(this),
      $w            = $(window),
      viewTop       = $w.scrollTop(),
      viewBottom    = viewTop + $w.height(),
      _top          = $t.offset().top,
      _bottom       = _top + $t.height(),
      compareTop    = partial === true ? _bottom : _top,
      compareBottom = partial === true ? _top : _bottom;

return ((compareBottom <= viewBottom) && (compareTop >= viewTop));

1 Answers1

0

You could refer to the following code to check whether the browser is IE or other browser:

<script type="text/javascript">
    function msieversion() {

        var ua = window.navigator.userAgent;
        var msie = ua.indexOf("MSIE ");

        if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./))  // If Internet Explorer, return version number
        {
            alert("IE ");
        }
        else  // If another browser, return 0
        {
            alert('otherbrowser');
        }

        return false;
    }
</script>

Code from this thread

Zhi Lv
  • 18,845
  • 1
  • 19
  • 30