1 . 页面头部插入代码:
<script type="text/javascript" src="/skins/jquery/index.js"></script>
<script type="text/javascript" src="/skins/jquery/jquery.highlight-3.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#highlight-plugin').removeHighlight().highlight('[!--keyboard--]');
})
</script>
2 . 加入css
<style>
.highlight {background:#FF0;color:#E00}
</style>
3 . 将要显示加亮的区域用id=highlight-plugin 的div 包括起来
<div id="highlight-plugin">(此DIV之间为你想关键字高亮区域,可设置任何的内容!) [!--empirenews.listtemp--]<!--list.var1-->[!--empirenews.listtemp--] </div>
<script type="text/javascript" src="/skins/jquery/index.js"></script>
<script type="text/javascript" src="/skins/jquery/jquery.highlight-3.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#highlight-plugin').removeHighlight().highlight('[!--keyboard--]');
})
</script>
2 . 加入css
<style>
.highlight {background:#FF0;color:#E00}
</style>
3 . 将要显示加亮的区域用id=highlight-plugin 的div 包括起来
<div id="highlight-plugin">(此DIV之间为你想关键字高亮区域,可设置任何的内容!) [!--empirenews.listtemp--]<!--list.var1-->[!--empirenews.listtemp--] </div>