Home >Web Front-end >JS Tutorial >The specific code for text overflow is to implement the overflow part and put it into a newly generated div_javascript skills

The specific code for text overflow is to implement the overflow part and put it into a newly generated div_javascript skills

WBOY
WBOYOriginal
2016-05-16 17:33:371483browse

I saw someone in the group asked a question about text overflow, how to put the overflow text into a newly generated div,

I thought about the principle, which is to judge whether it can be placed in the div, and if not , then insert it into a new div at the place where it should be disconnected. The code is as follows:

Copy the code The code is as follows:





Text is automatically inserted into different divs-Jason Yu








To add, possible problems 1. The symbol is in the next div The first one to appear is 2. Letters such as "student" will be broken and written, and other problems need to be judged by regular rules.
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn