JQ Syntaxhighlighter 插件优化设置
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Syntaxhighlighter 插件</title> <script type="text/javascript" src="syntaxhighlighter/scripts/shCore.js"></script> <script type="text/javascript" src="syntaxhighlighter/scripts/shBrushCss.js"></script> <script type="text/javascript" src="syntaxhighlighter/scripts/shBrushJScript.js"></script> <script type="text/javascript" src="syntaxhighlighter/scripts/shBrushJava.js"></script> <script type="text/javascript" src="syntaxhighlighter/scripts/shBrushPhp.js"></script> <script type="text/javascript" src="syntaxhighlighter/scripts/shBrushPlain.js"></script> <script type="text/javascript" src="syntaxhighlighter/scripts/shBrushRuby.js"></script> <script type="text/javascript" src="syntaxhighlighter/scripts/shBrushXml.js"></script> <script type="text/javascript" src="syntaxhighlighter/scripts/shBrushSql.js"></script> <link type="text/css" rel="stylesheet" href="syntaxhighlighter/styles/shCore.css"/> <link type="text/css" rel="stylesheet" href="syntaxhighlighter/styles/shThemeDefault.css"/> <script type="text/javascript"> SyntaxHighlighter.config.clipboardSwf = 'syntaxhighlighter/scripts/clipboard.swf'; SyntaxHighlighter.config.strings = { expandSource :'展开代码', viewSource :'查看代码', copyToClipboard :'复制代码', copyToClipboardConfirmation :'代码复制成功', print :'打印', help:'?', alert:'', noBrush:'请联系管理员,错误码: ', brushNotHtmlScript:'没有这类型的代码,错误码:', aboutDialog:'一站式网络' }; SyntaxHighlighter.all(); //屏蔽工具条显示 //SyntaxHighlighter.defaults['toolbar'] = false; </script> <style type="text/css"> .syntaxhighlighter .toolbar .item.printSource{ display: none !important;} .syntaxhighlighter .toolbar .item.about{ display: none !important;} </style> </head> <body> <pre class="brush:html;"> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no"> <title>新建H5模板</title> <style type="text/css"> body{ font-family:\5FAE\8F6F\96C5\9ED1,'Arial'; color:#5b5b5b; background-color:#fff; font-size:14px; overflow-x:hidden;} a{ color:#333; text-decoration:none;} a:hover{ color:#333; text-decoration:none;} img{ border:none;} i,em{ font-style:normal;} li{ list-style-type:none;} textarea{ resize:vertical;} input, select, textarea{ font-family:\5FAE\8F6F\96C5\9ED1,'Arial'; background-color:#fff margin:0; padding:0; outline:none;} </style> </head> <body> <h3>阅谁问君诵,水落清香浮</h3> <script type="text/javascript"> alert("测试吧"); </script> </body> </html> </pre> </body> </html>
Syntaxhighlighter 插件优化设置如下:禁止打印图标和帮助图标的显示,把提示的内容修改为中文,提供了禁止工具条显示的方法。
效果图:
相关推荐
nmgxzm00 2020-11-10
ifconfig 2020-10-14
hhanbj 2020-11-17
zfszhangyuan 2020-11-16
古叶峰 2020-11-16
一个智障 2020-11-15
jipengx 2020-11-12
81427005 2020-11-11
xixixi 2020-11-11
游走的豚鼠君 2020-11-10
苗疆三刀的随手记 2020-11-10
Web卓不凡 2020-11-03
小飞侠V 2020-11-02
帕尼尼 2020-10-30
爱读书的旅行者 2020-10-26
帕尼尼 2020-10-23
杏仁技术站 2020-10-23
淼寒儿 2020-10-22