3 ms·
May be it is something small as dividing the width by 2 and setting a lower milliseconds value for the setinterval so it runs the checks more often. Essentiall
by jestanoff 6y ago
May be it is something small as dividing the width by 2 and setting a lower milliseconds value for the setinterval so it runs the checks more often.
Essentially this is the same solution as in the post, just stripped down to the bare minimum of code, but I haven't tested it enough. There must be some edge case that it fails on