使用JavaScript进行寡妇/孤儿控制? [英] Widow/Orphan Control with JavaScript?
问题描述
它可以是库依赖的或 - 不可知的。我只是想知道一个脚本是否存在将分析页面(或者可能是某些节点已经给出)和......保护文本中的寡妇和孤儿。
It can be library-dependent or -agnostic. I just want to know if a script exists that will analyze the page (or maybe certain nodes that it has been given) and... "protect" against widows and orphans in the text.
保护是什么意思?我不知道。我考虑过看看自己是否可以拿出一个,但部分问题是我甚至不确定我会怎么做。
What does "protect" mean? I don't know. I considered seeing if I could come up with one myself, but part of the problem is I'm not even sure how I would go about doing it.
澄清:这将是网站的屏幕版本,而不是打印。
Clarification: This would be for the screen version of the site, not print.
推荐答案
<我相信你在HTML文档中描述排版寡妇?例如,单个单词是否包含在标题中的新行上?
I believe you're describing typographic widows in an HTML document? Where a single word wraps around onto a new line in a header, for example?
jQuery Widon't插件通过你的HTML寻找这个并在倒数第二个和最后一个单词之间放置一个不间断的空格以确保至少有两个单词换行换行。
The jQuery Widon't plugin goes through your HTML looking for this and puts a non-breaking space between the second-last and last words to ensure that at least two words wrap to a new line.
希望这会有所帮助,Karl
Hope this helps, Karl
这篇关于使用JavaScript进行寡妇/孤儿控制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!