jQuery仿word查找功能关键字高亮显示效果

来源:https://www.sucaihuo.com/js/3505.html 2018-03-02 17:15浏览(758) 收藏

jQuery仿word查找功能关键字高亮显示效果,网页搜索结果文本内容高亮显示代码。
jQuery仿word查找功能关键字高亮显示效果
分类:其它特效 > jQuery插件 难易:初级
查看演示 下载资源 下载积分: 10 积分
关注公众号,免费赠送安装视频教程、环境和学习视频,后面会不断更新。

js代码

<script type="text/javascript" src="js/highlight.js"></script>
		<script type="text/javascript">
			$(function() {
				// pull in the new value
				var searchTerm = $("#text-main").html();

				// remove any old highlighted terms
				//		$('#Context').removeHighlight();

				// disable highlighting if empty
				if(searchTerm) {
					// highlight the new term
					$("#Context").highlight(searchTerm);
				}
			})
		</script>
评论0
头像

系统已开启自动识别垃圾评论机制,识别到的自动封号,下载出错或者资源有问题请联系全栈客服QQ 1915635791

1 2