How to get content currently being displayed in browser viewport
问题 How can I get an indication of what part of a long document is currently being displayed? E.g. if my html contains 1,000 lines 1 2 3 ... 999 1000 and the user is near the middle showing the 500th line then I would like to get "500\n501\n502" or something like that. Obviously most scenarios would be more complex than this, but my requirement is to find which text is currently being displayed in the browser viewport so I can show a status value appropriate to the current text. Thanks Martin 回答1