0
I have the following code which is functional in IE7
function ScrollControl()
{
var obj = window.event.srcElement;
var evento = obj.componentFromPoint(event.clientX,event.clientY);
window.div_cabecalho.scrollLeft = obj.scrollLeft;
}
The same code reads the movement of a table at the time of the scroll and moves the table header at the same time. The code does not work in other browsers, I tried with combinations of pageX but I can not get values at the time of movement
The problem is not in "obj", with the same value that IE returns in other browsers, my problem is with "Event.clientX,Event.clientY". With an Alert IE returns the numeric position, in the other browsers returns undefined.
– Eduardo Calazans Júnior
You can do a jsFiddle with the problem so we can test?
– Sergio
This problem occurs because "normal" browsers do not use
window.event
but rather theevent
passed as argument in a function. If you show more code I can help fix this.– Sergio
At a glance in that event reference
scroll
of a "normal" browser. And give more details about your problem, because with the existing information it is a little difficult to help.– Fernando Leal
I have a div with a table and with the attribute onscroll="Scrollcontrol() which in theory would run the Scrollcontrol function and make the table header move together with the table scroll.
– Eduardo Calazans Júnior
I edited and posted the code in jsfiddle
– Eduardo Calazans Júnior