The code is a simple adding to a div's scrolltop with this code div.scrollTop+=value
The div has several hundred k of html text, and when the above code is run, there's a one second lag before it updates, as if the div is taking a long time to process.
However, if the same code is called from within a setInterval of maybe 250ms, after the one sec lag, updates then flash up instantly, indefinitely, showing that the div can be processed fine. I have read up about what causes reflows repaints etc but cannot work out how to get the instant effect without the lag in the timer or ideally outside the timer, its infuriating! thanks
Do you have the page online somewhere we can peek at?
sorry no, but it's so simple i cant see the point its just the following called from a keydown listener, or from a setinterval.
function blah(){divnameinavariable.scrollTop+=variablevalue}
I've tried setting setinterval to 0 and calling it immediately and variations on this but no dice. Always the lag then instant updates if done by timer but no way to get rid of the lag, or to get the instant updates without the timer.
sorry no, but it's so simple i cant see the point its just the following called from a keydown listener, or from a setinterval.
function blah(){divnameinavariable.scrollTop+=variablevalue}
I've tried setting setinterval to 0 and calling it immediately and variations on this but no dice. Always the lag then instant updates if done by timer but no way to get rid of the lag, or to get the instant updates without the timer.
should read function blah(){divnameinavariable.scrollTop=variablevalue}
Bookmarks