javascript - Determine What Text Is Hidden Due To overflow: hidden -
i've searched can't seem find answer on how this.
i'd able determine text hidden/invisible while using overflow: hidden in div. i'm trying manage pagination when screen printed.
in (simplified) example below i'd able determine text div-1 isn't visible can moved div-2 via javascript or jquery.
// css .divs { width: 250px; overflow: hidden; white-space: nowrap; } // html <div class="divs" id="div-1"> text can see ... text not visible due overflow: hidden </div> <div class="divs" id="div-2"></div>
as far know, there no method determine text hidden, text shown. may try workaround this: calculate width of text multiply letter metric (width) number of character. compare div with, not accurate.
ps: there solution here how find last visible word position in text container?
Comments
Post a Comment