Moving the caps to me done through the script. In IE, when a scroll occurs, the scroll itself first occurs, and then he realizes that there is another event, let me execute the event that was hung on the scroll. A cap jump occurs. She first leaves the scroll, and then jumps to its original place. In other browsers, the script is first executed and everything is fine.

An incorrect scroll happens when the mouse wheel is rotated and when the scroll bar is clicked. When clamping and pulling the scrollbar works correctly.

Is it possible to somehow block events on the wheel and on the scrollbar and write your own handler on them?

I already found an event on the mouse wheel - mousewheel. position:fixed do not offer, you need to fix not only the header, and even in two directions different elements

PS It turns out that with a large page tupit even when clamping and pulling the scroll bar. Therefore, it is required to block the scroll altogether.

PPS: This is what the scroll handler looks like:

  var scrollHandler = function (scrollTop, scrollLeft) { for(k = 0, len = cs.length; k < len; k += 1) { cs[k].style.top = scrollTop + 'px'; }; for(i = 0, n = firstColCells.length; i < n; i += 1) { firstColCells[i].style.left = scrollLeft + 'px'; }; }; 

arrays - header and column elements to be fixed enter image description here

the picture shows the structure of the table, where 0 - the cell is always in the same place. Dashes are the directions in which these cells can move. That is, a part of the cap is always stationary, and in another part there can be a lot of columns that will scroll horizontally. I hope I understood clearly

cs - cells of the entire header, firstColCells - cells of the first few columns, which are fixed with horizontal scrolling

    1 answer 1

    Without the code, I can not say much ...


    You can, for example, put a crutch for IE, so that the code is not executed

     $(document).on('scroll', function (evt) { if (isIE) { evt.preventDefault(); return false; } ... }); 

    There are no other options yet, because blindly trying to solve a problem is stupid

    • The solution does not work, as soon as I did not try to stick it. I think I found the answer in the msdn.microsoft.com documentation. IE always does first and then thinks. That is, it is impossible to prevent scrolling in principle - Sergey
    • I have done cross-browser features with scrolls more than once and in IE 9+ everything was fine with that. So I am inclined towards the fact that the script uses not quite the right ways to scroll your cap. - Pleshevskiy
    • I will try to use the idea, maybe something will work out - Sergey
    • Added handler code, can you advise what? - Sergey
    • at first glance, it’s not quite clear to me how this cap works for you ... Please skip, please, also the structure and variables cs. In general, it seems that the cap consists of individual elements and you each go through the coordinates and change them in turn. Here until I see the structure I do not understand this logic. - Pleshevskiy