您现在的位置是:首页> 网站开发> jQuery
解决百度编辑器UEditor行号错位问题
- 5296人已阅读
- 时间:2018-10-16 08:50:37
- 分类:jQuery
自从小编解决了百度编辑器自动换行的功能,那么换了行,行号应该也随之改变.这里使用了jQuery遍历修改CSS样式.直接上代码如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | <script type= "text/javascript" > $( function (){ SyntaxHighlighter.highlight(); $( "table.syntaxhighlighter" ).each( function () { if (!$( this ).hasClass( "nogutter" )) { var $gutter = $($( this ).find( ".gutter" )[0]); var $codeLines = $($( this ).find( ".code .line" )); $gutter.find( ".line" ).each( function (i) { $( this ).height($($codeLines[i]).height()); $($codeLines[i]).height($($codeLines[i]).height()); }); } }); }); </script> |