我需要javascript来检测每个浏览器包装的文本行,并将其包装到<span class="line">中。
我遇到了一些文章,讨论如何测量每个单词的y轴,但还没有看到一个可靠的解决方案。
这是我到目前为止所掌握的。请在上查看。
HTML
<div class="inline-bg">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec cursus condimentum metus, et placerat augue rutrum vitae. Donec a
我用xslt编写了这段代码,
<xsl:template match="/">
// some truncated js code here
for (var i=0 ; i < arrIdentifiers.length ; i++) {
$("#list").append('<li class="ui-widget-content"><span class
JS
var part_of_doc = false; //a character has been found that is not part of the visible document
var body;
//will be used to generate random rgb
function randint(max, min) {
return Math.floor((Math.random() * (max - min)) + min);
}
//generate a random rgb(x,y,z) string
function randRGB(){
假设我有一个很长的段落。当我单击一行时,JS/jQuery会在该行的开头添加一个空的<span>标记-就在该行的第一个单词之前。
f.e:这是我的段落:
<p>
It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has.
</p>
当我单击第二行时,将在第二行的第一个单词之前插入
我有这样的数据:
data: {
content:"<p><span style=\"font-size:16px\">Berikut adalah beberapa pemberontakan yang pernah terjadi di daerah.</span></p>\r\n\r\n<p><span style=\"font-size:16px\"><strong>1. Pemberontakan Angkatan Perang Ratu Adil (APR