jquery让指定的元素闪烁显示的方法
更新时间:2015年03月17日 14:54:07 作者:上大王
这篇文章主要介绍了jquery让指定的元素闪烁显示的方法,涉及jQuery操作css样式的技巧,非常具有实用价值,需要的朋友可以参考下
本文实例讲述了jquery让指定的元素闪烁显示的方法。分享给大家供大家参考。具体如下:
这段jQuery代码非常简单,功能就是让指定的元素不断的变换颜色,闪烁显示,调用也非常简单。
jQuery.fn.flash = function( color, duration )
{
var current = this.css( 'color' );
this.animate( { color: 'rgb(' + color + ')' }, duration / 2 );
this.animate( { color: current }, duration / 2 );
}
// https://www.jb51.net Then use the above function as:
$( '#importantElement' ).flash( '255,0,0', 1000 );
希望本文所述对大家的jQuery程序设计有所帮助。
相关文章
jQuery Validate验证表单时多个name相同的元素只验证第一个的解决方法
这篇文章主要介绍了jQuery Validate验证表单时多个name相同的元素只验证第一个的问题及解决方法,需要的朋友可以参考下2016-12-12
z-blog SyntaxHighlighter 长代码无法换行解决办法(基于jquery)
这篇文章主要介绍了z-blog SyntaxHighlighter 长代码无法换行解决办法(jquery),需要的朋友可以参考下2015-11-11
jQuery初学:find()方法及children方法的区别分析
总经一下前段时间用于的jQuery方法:find及children。需要的朋友可以参考下。2011-01-01


最新评论