![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
jquery
文章平均质量分 73
hjjhce
这个作者很懒,什么都没留下…
展开
-
当网页图片不存在时的处理方法
img src="图片的url地址" alt="图片XX"/> 当在页面显示的时候,万一图片被移动了位置或者丢失的话,将会在页面显示一个带X的图片,很是影响用户的体验。即使使用alt属性给出了"图片XX"的提示信息,也起不了多大作用。其实,可以这样处理:当图片不存在的时候,会触发onerror事件,我们可以在该事件中做一下补救的工作,比如:1、让这个图片元素隐藏:转载 2015-08-18 15:08:09 · 546 阅读 · 0 评论 -
搜索关键字高亮
var searchKey = '';if(searchKey != '' && searchKey != null){ var regExp = new RegExp(searchKey,'gi'); $('.product-list-tit').each(function(){ var html = $(this).html();转载 2015-08-18 15:12:28 · 334 阅读 · 0 评论