相关疑难解决方法(0)

将一个字符串重叠到另一个字符串突出显示问题

我有一个字符串,可以像

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged
Run Code Online (Sandbox Code Playgroud)

现在,在这里我有一个json,它有字符串开始和结束偏移,我想突出显示.现在,我使用的逻辑是这样的 -

$scope.highlightHTML = function(content, startoffset, endoffset) {
  var className = 'mark';
  console.log(content.substring(startoffset, endoffset));
  return content.replace(content.substring(startoffset, endoffset), '<span class="' …
Run Code Online (Sandbox Code Playgroud)

javascript css jquery html5 angularjs

5
推荐指数
0
解决办法
111
查看次数

标签 统计

angularjs ×1

css ×1

html5 ×1

javascript ×1

jquery ×1