您现在的位置: 万盛学电脑网 >> 程序编程 >> 脚本专题 >> javascript >> 正文

jquery让指定的元素闪烁显示的方法

作者:佚名    责任编辑:admin    更新时间:2022-06-22

 这篇文章主要介绍了jquery让指定的元素闪烁显示的方法,涉及jQuery操作css样式的技巧,非常具有实用价值,需要的朋友可以参考下

   

本文实例讲述了jquery让指定的元素闪烁显示的方法。分享给大家供大家参考。具体如下:

这段jQuery代码非常简单,功能就是让指定的元素不断的变换颜色,闪烁显示,调用也非常简单。

? 1 2 3 4 5 6 7 8 jQuery.fn.flash = function( color, duration ) { var current = this.css( 'color' ); this.animate( { color: 'rgb(' + color + ')' }, duration / 2 ); this.animate( { color: current }, duration / 2 ); } // http://www.jb51.net Then use the above function as: $( '#importantElement' ).flash( '255,0,0', 1000 );

希望本文所述对大家的jQuery程序设计有所帮助。