I do not know if there is anything for this. But I think this will lead to more confusion, that it will make any visual improvement ever. The user will not be happy when he scrolls down and discovers that the lines simply “pop up” suddenly, as opposed to the usual weakening as a result of the scroll action.
In the end, when we talk about a scrollable HTML element with visible scrollbars, the user's text may be partially shown, and that’s normal, and it needs to be scrolled down to read the rest. I would not recommend this.
But for a technical answer, I think you will need to fix the CSS line height property of this scroll element, say, make 8px or something suitable for your layout. Then grab the scroll event and split the jQueryTop () scroll by this CSS line height, and then check the results: if it has a beat, then there is a “partially visible” line. Do not forget the margin and indentation, which can cause calculation errors.
source share